ankur trapasiya wrote:
but i can't understand what exactly being done here .....
we are inheriting inner class.....
so simply "new Outer()" in constructor why is not enough??? what does "new Outer().super()" mean ???
would you please clear my doubt ???
The thing to remember here is that all inner classes depend on a outer class (assuming that the inner class is not a nested (aka static) class). This means that it is not possible to instantiate an inner class without an outer class.
This is not a legal statement...
You need an outer class...
This is also true when a subclass calls the constructor of its super class -- it needs an instance of the super class outer class. The exception is if the subclass is also an inner class that has the same outer class (or a subclass of the same outer class), then it will work, as it can use the sub class outer class.
Henry