This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Mock Exam Errata and the fly likes Roundup #208 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 » Mock Exam Errata
Bookmark "Roundup #208" Watch "Roundup #208" New topic

Roundup #208

Gil Salu

Joined: Nov 10, 2000
Posts: 6
could someone clearify #208?
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
You know, I didn't memorize that one.

"JavaRanch, where the deer and the Certified play" - David O'Meara
Paul Caudle
Ranch Hand

Joined: Jun 08, 2000
Posts: 64
I think perhaps this question might fit well in the Java Ranch forum or maybe we could just get one of the Sheriffs to clarify what #208 is...or we can run the game until we get it...that's what I think I'll do in the meantime.
Paul Caudle
Ranch Hand

Joined: Jun 08, 2000
Posts: 64
Can one object access a private variable of another object of the same class?
<h6>it only took me about 2 minutes to find it...but I got a lot of the questions wrong in the meantime</h6>
The answer to this question is Yes, it can. I think the explanation of this answer in the round-up is that the access is granted to the class, not the object...
To explain that a little further, any object created from a specific class has access to the private variables of any other object created from that class.
Take a look:

Even though there are 2 different objects here (referenced using x and b) b is still able to access the private variable of object x. Why? Because the objects referenced by x and b were both created from the same class (Sharing), and objects created from the same class have access to each other's privates ( get your mind out of the gutter, you know what I mean!).
I hope that helps...send me an e-mail if you want a little clarification and I'll post it up here.

[This message has been edited by Paul Caudle (edited November 13, 2000).]
Gil Salu

Joined: Nov 10, 2000
Posts: 6
Thanks all...after I re-read the question I understood what it was talking about...
It is sorta covered in the JavaRanch Style Guide.
subject: Roundup #208
Similar Threads
PA #1.....picture association
Specifications for SOA
puzzle of the day
So Microsoft tries to recruit Eric Raymond ...
Need a function for byte operation