Prev Up Next

A class describes a collection of objects that share behavior. The objects described by a class are called the instances of the class. The class specifies the names of the slots that the instance has, although it is up to the instance to populate these slots with particular values. The class also specifies the methods that can be applied to its instances. Slot values can be anything, but method values must be procedures.

Classes are hierarchical. Thus, a class can be a subclass of another class, which is called its superclass. A subclass not only has its own direct slots and methods, but also inherits all the slots and methods of its superclass. If a class has a slot or method that has the same name as its superclass's, then the subclass's slot or method is the one that is retained.

Prev Up Next

Log in or registerto write something here or to contact authors.