question seen in this site: (#232) TRUE or FALSE: a non-static inner class always has free access to ALL member data of its enclosing (outer) class. Answer: TRUE An inner class has a special relationship and can see even private member data of the outer class. What if it is an anonymous inner class defined inside a method?? As far as I know those classes can only refer to final member variables of the outer class (wether public or private). Am I right, or did I misunderstand the question?
Eduardo, you're confusing "member" variables and "local" variables. Member variables belong to the enclosing class, and are always available freely to the inner class. Local variables usually cease to exist when the method in which they are defined exists; however, by marking these local variables final (including paramater variables, which are also local) you can use them in your inner class. An inner class may not use any non-final local variables.