This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Changing value of Private Var outside its class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Changing value of Private Var outside its class" Watch "Changing value of Private Var outside its class" New topic
Author

Changing value of Private Var outside its class

Mohit Agarwal
Ranch Hand

Joined: Mar 30, 2004
Posts: 88
Plz. help me to figure out this program.

To my surprise the value of Private Var had changed.

Please Explain This to me!

(code tags to show nesting added)
[ August 09, 2004: Message edited by: Barry Gaunt ]
Dan Chisholm
Ranch Hand

Joined: Jul 02, 2002
Posts: 1865
Mohit,

An enclosing class does have access to the private members of any class nested within it.


Dan Chisholm<br />SCJP 1.4<br /> <br /><a href="http://www.danchisholm.net/" target="_blank" rel="nofollow">Try my mock exam.</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Changing value of Private Var outside its class