Thursday, March 12, 2009

What is the difference between local inner class and non-local inner

Question :What is the difference between local inner class and non-local inner
class? (CoreJava)

Answer :Local inner classes may only access the local variables or method
parameters of the code block in which
they are defined. Local inner classes may only access final variables which
have been assigned a value.
A non-local inner class has access to all variables declared within the
encapsulating class

No comments: