~ Office Supplies ~~ Buy Posters ~~ A-Z Products ~~ Website Advertising


Class (object-oriented programming) - Wikipedia

<<Up     Contents

Class (object-oriented programming)

A class is a kind of template (not to be confused with a C++ template, however) that describes the underlying structure of a group of objects. It could be said that a class is a blueprint, and an object is a house. An object belonging to a class is also called an instance of that class. If humanity were a class, then [you] would be an instance of the class [humanity].

A class specifies the data items each object of the class contains and the operations or methods that can be performed on each object belonging to the class (in object-oriented languages that lack generic functions).

(Some languages have objects but no classes. In these languages, objects are not restricted to structure provided by classes, and can be changed at will. This less common technique is called object-based programming.)

Subclasses and Superclasses

Classes are often related in some way. The most popular of these relations is inheritance, which involves subclasses and superclasses, also known respectively as child classes (or derived classes) and parent classes (or base classes). If [cars] was a class, then [Jaguar] and [Porsche] might be two sub-classes. If [Button] is a subclass of [Control], then all buttons are controls.

Some programming languages (for example C++) allow multiple inheritance - they allow a child class to have more than one parent class. This technique has been criticized by some for its unnecessary complexity and being hard to implement efficiently, though some projects have undoubtedly benefited from its use. Java, for example has no multiple inheritance, its designers feeling that this would be more trouble than it was worth.

Because the Microsoft Windows API was originally designed in an object-oriented way, each window is an instance of a class called the "window class".

Sub- and superclasses are considered to exist within a hierarchy.

See also: hierarchy, object-oriented programming, abstract class

For related meanings of the word "class", see Class. For other uses of the word class within computer science, see Class (computer science)

wikipedia.org dumped 2003-03-17 with terodump




 
 
40 ct mint green HIDDENITE Faceting cabbing rough raw uncut gemstone crystal nice jewel Beautiful 4
 40 ct mint green HIDDENITE ing cabbing raw uncut crystal nice jewel Beautiful 4 
 
5 grams purple AMETHYST Quartz cabbing tumbled polished rough jewelry gemstones 21 carat PRETTY Nice
 5 grams purple AMETHYST Quartz cabbing tumbled polished jewelry 21 carat PRETTY Nice 
 
Light green butter new jade Serpentine gem stone polished faceted Briolette stringing bead single
 Light green butter new jade Serpentine polished ed Briolette stringing bead single 
 
20 carats metallic silver gray HEMATITE gem stone rectangle magnetic cab rough gemstone 4 grams nice
 20 carats metallic silver gray HEMATITE rectangle magnetic cab 4 grams nice 
 
Tanzanite blue IOLITE gems jewels Loose natural 4mm square faceted cut jewelry gemstone pair 4 mm pr
 Tanzanite blue IOLITE jewels Loose 4mm square ed cut jewelry pair 4 mm pr