This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi, can you please tell me what is private to object. i think a private member variable in a class is private to an object, but you said it is private to class only, then tell me what kind of data will become private to an object.
Joined: Jul 23, 2003
Originally posted by sri rallapalli: ... i think a private member variable in a class is private to an object, but ...
I am also with you but this link below has something else to say, JavaRanch Rule Round-up Game You may please visit the link. It has 161 fun-packed mind twisters. But I found this particular question a bit weird.
according to the link u've provided, the two Employee objects have been made to access their pravate variables in their own class. If there we'd have created these objects in some different class, then definately it wasn't possible so in that case it goes wrong....but there one might say that as per the defination of 'private' that it's in a class and hence first of all if we're going out of the very class we don't have anything left to debate. So two objects of same class accessing their private variables is only possible in the same class...