This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Inner Classes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Inner Classes" Watch "Inner Classes" New topic
Author

Inner Classes

Adrian Yan
Ranch Hand

Joined: Oct 02, 2000
Posts: 688
What are the variables can the non-static inner classes access? Are they the static variables, final instance variables?
What about anonymous class?
bill bozeman
Ranch Hand

Joined: Jun 30, 2000
Posts: 1070
Non-static inner classes, not defined inside methods, can access all variables of the top-level class.
Non-static inner classes, defined inside methods, can access all variables fo the top-level class, and all final variables of the enclosing method.
Bill
 
jQuery in Action, 2nd edition
 
subject: Inner Classes
 
Similar Threads
doubts from the john hunt's mock test
Inner classes.
Inner classes
Inner classes
Inner Class Problem