This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes access a private member 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 "access a private member" Watch "access a private member" New topic

access a private member

Lee Xu
Ranch Hand

Joined: Aug 24, 2001
Posts: 77
I know that the object can access the private member of another object of the same class, but forget the example. Can someone give a concrete example on this? Thanks.
Amir Ghahrai
Ranch Hand

Joined: Jun 19, 2002
Posts: 110
Try reading the following link, the private section

Dan Chisholm
Ranch Hand

Joined: Jul 02, 2002
Posts: 1865
Here's a simple example.

Dan Chisholm<br />SCJP 1.4<br /> <br /><a href="" target="_blank" rel="nofollow">Try my mock exam.</a>
Lee Xu
Ranch Hand

Joined: Aug 24, 2001
Posts: 77
Thanks for your prompt reply.
I agree. Here's the link:
subject: access a private member
It's not a secret anymore!