Skip to main content

17.2) The Concept Of Classes


It is a natural human tendency to organise objects in the world by grouping them together into different categories or classes. Objects that belong to a given class exhibit the same range of behaviour and are described by the same set of attributes.

A class effectively ‘specifies what an object is like’. When you know the class to which an object belongs, you immediately have some idea of the attributes that it possesses and the ways in which it can behave.

Essentially, classes are an important organising principle for describing the world around us.

A class to represent a bank account can be represented in Unified Modelling Language (UML) thus:

Top to bottom, the three compartments contain: the class name, its attributes and the operations supported by the class