Originally posted by Divya Gehlot:
Can any one exaplain why it is so?
Since it is specified this way in the
JLS. Quote from
8.1.3 Inner Classes and Enclosing Instances.
Any local variable, formal method parameter or exception handler parameter used but not declared in an inner class must be declared final. Any local variable, used but not declared in an inner class must be definitely assigned (�16) before the body of the inner class.