aspose file tools*
The moose likes Beginning Java and the fly likes Can objects of sam class can access each others private variables?if yes then how ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Can objects of sam class can access each others private variables?if yes then how ?" Watch "Can objects of sam class can access each others private variables?if yes then how ?" New topic
Author

Can objects of sam class can access each others private variables?if yes then how ?

Waez Ali
Ranch Hand

Joined: Jan 24, 2005
Posts: 43
I got this question when i was playing that roundup game
It is (#80)th question & it says yes it is possible.
please somebody make me understand this concept with some example i m new to javaranch....
Steven Bell
Ranch Hand

Joined: Dec 29, 2004
Posts: 1071
Yes, and a common example would be the equals method.



This is a common example. Because we are in the same class, even though it is different instances, we can access the private fields.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can objects of sam class can access each others private variables?if yes then how ?