Classes


| Site Map | HomePage | OOP Concepts | OOP Design | Glossary | Evaluation/Comments |

Objects with the same data structure (Attributes) and behavior (Methods or Operations) are grouped together (called a class ).


EXAMPLE

A computer game might consist of klingons, monsters, and vulcans. Although each of these objects may behave differently they all belong to a larger class called alien.

All objects in the alien class have attributes in common (e.g. they all use spaceships to fly around the galaxy) and perform common operations (e.g. try to kill you).

By categorizing a klingon as a member of the alien class we know something about it's attributes and operations.


Each class describes a possibly infinite set of individual objects. Each object is said to be an instance of a class .

Each instance of the class, has its own value for each attribute but shares the attribute names and operations with other instances of the class.

Each attribute name is unique within a class (as apposed to being unique across all classes) so class Person and class Company may each contain an attribute called Address


Click here to try Class Test

<< Objects Encapsulation >>




Links to the rest of the site:
| Site Map | HomePage | OOP Concepts | OOP Design | Glossary | Evaluation/Comments |

Author: Deniz Zubair Choudhury
Last Update: May 1999