Hi Neha,
code
____________________________________________________________
1: class outer {
2: class inner {
3: inner() {
4: System.out.println("Inner class constructor");
5: }
6: }
7:}
8:
9:class sub extends outer.inner {
10:// sub() {}
11:// Constructor must explicity specify a containing instance when invoking the superclass constructor.
12: sub(outer o) {
13: o.super();
14: System.out.println("subclass constructor");
15: }
16:
17: public static void main(String args[]){
18: outer O =new outer();
19:// sub s = new sub();
20: sub s=new sub(O);
21: }
22:}
____________________________________________________________
It is possible for a subclass to extend a non-static inner class. This means that the subclass does not have a containing instance, but its superclass does. When the subclass constructor invokes the superclass constructor, it must specify the containing instance. Please have a look at line no.12, 13 & 20.
I hope this helps.
Regards,
Malar.
[This message has been edited by Malar Ravi (edited November 07, 2001).]