Originally posted by Geoffrey Falk:
But how does an instance of an inner class know which instance of the outer class it belongs to?
Does it resolve to:
1) The instance which created it?
2) An instance which has it as an instance variable?
Originally posted by Edward Brode:
It's also important to remember that we are talking about member inner classes, not local inner classes that are declared inside a method like an instance of an ActionListener, etc. in the AWT, among other places.
Originally posted by Jim Yingst:
Usually it does - but not if it's declared in a static context (e.g. in a static method).