aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Private Variables Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Private Variables" Watch "Private Variables" New topic
Author

Private Variables

Puja Sinha
Greenhorn

Joined: May 25, 2011
Posts: 27
Can one object access a private variable of another object of the same class ?
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1478
    
    6

Do you mean something like this?


If yes, the answer should be yes, because access specifier is specific to class, not specific to an object of the class.


Swastik
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3071
    
  33

private variables can be accessed only with in the class where they are declared.
I would suggest you to write a small program to clear your queries. If you are still stuck you can post your code here and we can help you out. This way you can learn better and retain the concepts longer.


Mohamed Sanaulla | My Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Private Variables