Originally posted by Sasikanth Malladi:
Hi!
Can a local inner class access and manipulate the class variables (the ones not within the same scope as the nested class or passed to the method enclosing this class)?
Thanks,
Sasikanth
local class in a static context - i.e. in static method
can access static variables in the enclosing outer class, the accessible static variables in the super class if any, and the final variables in the method
local class in a non-static context - i.e. non-static method
can access static and non-static variables in the enclosing outer class, and accessible static and non-static variables in the super class if any, and the final variables in the method
For good examples read Mughal Chapter 7.