I think it�s sad how inner classes has made the JLS so difficult to understand and, I suppose, the language so much more complex.
An inner class C is a direct inner class of a class O if O is the immediately lexically enclosing class of C and the declaration of C does not occur in a static context. A class C is an inner class of class O if it is either a direct inner class of O or an inner class of an inner class of O.
The Inner that is named is not the true Inner.
The Inner that is named is not the true Inner.
There is this though: an xxx.Float or xxx.Double class inherits itself as a member. Can't think of how that would be a problem, but it does seem odd.
I suppose you know about this one:Isn't this a corollary: "An inner class must be declared in a non-static context"?
An instance of an inner class I whose declaration occurs in a static context has no lexically enclosing instances. JLS 8.1.2
An instance of an inner class I whose declaration occurs in a static context has no lexically enclosing instances. JLS 8.1.2
The Inner that is named is not the true Inner.
It's the second sentence I'm pointing at. I realize it doesn't say "if and only if", but if it doesn't mean that, what is its intent?An inner class C is a direct inner class of a class O if O is the immediately lexically enclosing class of C and the declaration of C does not occur in a static context. A class C is an inner class of class O if it is either a direct inner class of O or an inner class of an inner class of O.
The Inner that is named is not the true Inner.
1. Normally, when an instance method of the enclosing class is invoked, �this� is the enclosing instance.
2. However, if B extends A, when an instance method of the enclosing class is invoked, �this� is Not the enclosing instance!
Is this the correct explanation: The method of the superclass shadows the method of the enclosing class?
1. Normally, when an instance method of the enclosing class is invoked, �this� is the enclosing instance.
2. However, if B extends A, when an instance method of the enclosing class is invoked, �this� is Not the enclosing instance!
Is this the correct explanation: The method of the superclass shadows the method of the enclosing class?
The Inner that is named is not the true Inner.
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |