posted 18 years ago
At line 1, basically two objects are created.
First of class A, then of your class B. So basically you have two instances here and instance of A act as a subobject which is actually wrapped within intstance of subclass.
Similary in your code, an instance of InheritInner must have an instance of Inner class and you know that Inner class always require an instance of Outer class.
But in your code, there is not instance of Outer class used in creation of Inner instance. Although you hav created, but you hav not used.
Modify your code as below...
Here At line o.super() before call to Super class constructor(i.e. Inner class constructor), you already hav a Outer instance o as a context.
You can also make your Inner class static without altering any further code. But in that case, its not actually Inner class rather its better to name it Nested class.
Regards
Naseem
[Message edited: Used Real words]
[ July 21, 2006: Message edited by: Naseem Khan ]