wood burning stoves 2.0*
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


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
 
Don't get me started about those stupid light bulbs.
 
subject: Inner Classes