posted 19 years ago
Hi,
I've committed to memory the fact that method local inner classes can only access members of the enclosing class and final local variables. However I can't work out why they are allowed to access final local variables.
I would have thought that even if a local variable is declared final in the method, it is still part of the stack frame and no longer exists when the method exits. Thus the method local class should not be allowed to access it.
Obviously my thinking about this is wrong. Can someone tell me where?
SCJP 1.4 91%, SCJP 1.5 88%, SCJD B&S