Inner classes in code blocks, such as method body, constructor or initialization block is known as Local Inner Classes.
As local inner classes are completely inaccessible outside the method.
If you are defining any local variable you can not access those variables outside the method.
Then what is the use of Local Inner classes?
Joined: Oct 13, 2005
Most commonly to start a Runnable, or a Listener in Swing. Have a look at this old thread.
Joined: Jul 11, 2001
Do you know what anonymous inner classes are good for?
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus