Glossary: Class

Objects are miniature programs, consisting of both code and data. Every object belongs a class which is like a object factory; each time a new object is needed, it is built (or instantiated), using information supplied by the class. The class contains all the code (i.e. member functions) and a description of the object data (i.e. data members)

Building a object involves:-

  1. Allocating space for its personal copy of data members
  2. Calling its initialisation member function (i.e. its constructor)
When an object is no longer needed:-
  1. Its termination member function (i.e. its destructor) is called
  2. The space it occupied is released.
Note that, although each object has its own copy of the data, they all share a single copy of the code.
Go Back to the The Glossary Top Page

If you have any comments about this page please send them to Nick West