Classes are sets of objects which share a common structure and behaviour.
In technical language, the structure of a class is determined by the variable which represents the state of an object of that class, and the behaviour is given by a set of methods associated with the class. A class may be a specialisation of another, or it may be composed of other classes or it may use other classes in a client-server relationship. Classes are also prototypes for objects in an object oriented language. (A prototype is an original thing from which copies are made).
Now that may be comprehensive and accurate...but is it any clearer than mud? What does it mean? Well, it is actually fairly simple. Read on to find out.
An example of Objects within a Class
We have said that we define an object by the type of class it is and that objects are individual instances of a class.
As an example, you may create an individual object which you call 'Fred'
from the class 'Frog'.
The Frog class defines what it is to be a Frog object, and all the 'Frog-related' messages a Frog object can act upon. You could make more than one object of this class, and call them Fred, Frieda, Frodo...whatever. The Frog class then defines the messages that the Frog objects understand, such as 'jump', or 'croak'. All object-oriented languages have the means (sometimes referred to as a factory) to 'manufacture' object instances from a class definition.
In other words, all OOPs have the means to create objects (for example 'Fred' and 'Frieda'), once a class (for example 'Frog') has been created.
Visit An Area
| Technophile_City_(INFOTECH) | The_Time_Machine_(HISTORY) | The_Tree_House_(SOSE) | Lessons_Index | Assessment_Instruments | Maps | Power Point | Proforma | Links | Gallery | Games | Humour | Prizes | WebRings | Soapbox | Search_Engines | Site_ Map_ |