This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Rust Web Development and have Bastian Gruber on-line!
See this thread for details.
Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Roundup #208

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
could someone clearify #208?
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You know, I didn't memorize that one.
 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Paul Caudle
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks all...after I re-read the question I understood what it was talking about...
 
reply
    Bookmark Topic Watch Topic
  • New Topic