posted 16 years ago
Hi,
As we know method local inner class can
a) Access the instance variables of outer class[ This is usual for any type of inner class]
b) Cannot access local variables of method in which its defined [because local variables live in stack and die after method exceution]
Howeve method local inner class can access final local variables declared in the method, in which the class is defined.
Does this mean, that final local variables
a) Live in heap and not in stack, even when they are local variables?
b) If they live in heap why cant we access these variables from some other methods?, Why can we access them from method local inner class, As method local inner class object can still live even after method terminates.
Hope my question is clear.
Thanks
Deepak