File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Waez Ali
Ranch Hand
Posts: 43
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1071
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic