The Source for Java Technology Collaboration
User: Password:



Start New Message Delete Post a Reply

Article: 
 (Not So) Stupid Questions 3: Private Access
Subject:  Worrying about object-privacy
Date:  2004-12-17 09:34:20
From:  heaththegreat


Privacy is used to hide implementation from the user of a class.

You needn't worry about Object-level privacy because you (the Object's author) are the only one that has access to the internals of the Object.

It does, of course, mean that you can shoot yourself in the foot (as you did with the second divide implementation). But, assuming you write the class correctly, no one can programmatically change the implementation.

 Feed java.net RSS Feeds