*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes another question regarding non-static member class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "another question regarding non-static member class" Watch "another question regarding non-static member class" New topic
Author

another question regarding non-static member class

sura watthana
Ranch Hand

Joined: Sep 13, 2004
Posts: 77
please read the statement below.
"Code in a non-static member class can directly refer to any member (including nested) of any enclosing class or interface, including private members. No explicit reference is required."

could anyone give me the reason to support this statement.

thank you

Nanda Kishore
Greenhorn

Joined: Aug 17, 2003
Posts: 9
As a member of its enclosing class, a nonstatic nested class has a special privilege: It has unlimited access to its enclosing class's members, even if they are declared private. However, this special privilege isn't really special at all. It is fully consistent with the meaning of private and the other access specifiers. The access specifiers restrict access to members for classes outside of the enclosing class. The nested class is inside of its enclosing class so that it has access to its enclosing class's members. For details please refer:
http://java.sun.com/docs/books/tutorial/java/javaOO/nested.html
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: another question regarding non-static member class
 
Similar Threads
Thread --> run() method
interface defined in inner class
Doubt: Main method
static objects
innerclasses