Monday, November 22, 2010

Java - Data Hiding / Encapsulation

The practice of declaring instance variables using the private access modifier is called data hiding (encapsulation). => can only be accessed by methods of the same object’s class.  => this prevents the object’s instance variable from being accidentally changed by some other class in the program.

No comments:

Post a Comment