Information Hiding

 [Previous Chapter]  [Previous Page]  [Contents]  [Next Page]  [Next Chapter]

*Classes in Java (and some other OO languages) allow to specify three levels of access for attributes and methods of their objects:

*Public: Free access to every client.
 
*Protected: Access only to its implementation and the implementation of subclasses.
 
*Private: Access only to its implementation.
 

*Restricting access (information hiding) allows to reduce the number of potential dependencies which in turn reduces the amount of work necessary in case of changes and/or extensions.
 

 [Previous Chapter]  [Previous Page]  [Contents]  [Next Page]  [Next Chapter]
Copyright © 2001, 2002 Andreas Borchert, converted to HTML on February 11, 2002