"Thinking in Java" says:
Because the Inner-class constructor must attach to a reference of the enclosing class object,
Things is slightly complicated when you inherit from an inner class. The problem is the
"Secret" reference to the enclosing class object must is initialized, and yet in the derived class
There ' s no longer a default object to attach to.
PackageCOM.ZYWJ;classA {classb{B (String s) {System.out.println (s); } }} Public classAppextendsa.b {App (a) {a).Super("Hello"); } Public Static voidMain (string[] args) {A a=NewA (); App App=NewApp (a); }}
Here's the a.super ("Hello"); it's a little hard to understand. I thought it was the Super object of object A at first.
is actually (object a). ( Object b) ("Hello"), because the app inherits A.b, so the super here is pointing to B.
Idea told us:
Inheritance of Java inner classes