Cover Data Structures and Algorithms with Object-Oriented Design Patterns in Java
next up previous contents index

Objects and Classes

 

``An object  is a class instance   or an array[16].'' The class  of an object determines what it is and how it can be manipulated. A class encapsulates methods, data, and semantics. This encapsulation is like a contract between the implementer of the class and the user of that class.

The class construct is what makes Java an object-oriented language. A Java class definition groups a set of values with a set of operations. Classes facilitate modularity and information hiding. The user of a class manipulates object instances of that class only through the methods provided by that class.

It is often the case that different classes possess common features. Different classes may share common values; they may perform the same operations; they may support common interfaces. In Java such relationships are expressed using derivation and inheritance.




next up previous contents index

Bruno Copyright © 1998 by Bruno R. Preiss, P.Eng. All rights reserved.