Class


Objects in the world around us are of two kinds: physical objects and conceptual objects. All objects share two distinctive features: they all have attributes and they all exhibit some behaviour. 

The attributes are also called characteristics or properties. Examples of physical objects are: a cat, a piece of rock, or a person. Conceptual objects include a bank account, an institution or any idea that represents a non-physical entity. 

An object belongs to a type. The cat is a type of animal, the rock is a non-living thing and a bank account could be a savings or current account type.

In order to model an object in software, the attributes and behaviour of the object are considered. The attributes are represented as data members called variables. The behaviour is represented as methods. The attributes and the behaviour are wrapped up into a single unit called a class. 

A class therefore represents a type of object.