Superclass (computer science)

Superclass (computer science)

In computer science, a superclass is a class from which other classes are derived. A superclass is also called a "parent class". The classes that are derived from a superclass are known as "child classes", "derived classes", or subclasses. We can also say that a class A "extends" class B when A is a "subclass" of the B "superclass".

A superclass allows for a generic interface to specialized functionality through the use of virtual functions.

The superclass mechanism is extensively used in object oriented programming due to the reusability that can be achieved: common features are encapsulated in modular objects.

Languages may support both abstract and concrete superclasses.

Base Class

A "base class" is a class that has no superclass, and is therefore at the base of the tree of subclasses. Most object-oriented programming systems provide a library of classes from which the developer derives their own. These libraries will often have a single or a small set of base classes which provide the foundation for the library.

Where a language or library has a single base class then this is also know as a Top type.

In UML a class may have its "root" property set to show that it is a base class.

In C++ parlance (also used in C# and others), the term base class is used instead of superclass.

ee also

*Top type
*Implementation inheritance
*Inheritance semantics
*Virtual Inheritance


Wikimedia Foundation. 2010.

Игры ⚽ Нужен реферат?

Look at other dictionaries:

  • Inheritance (computer science) — In object oriented programming, inheritance is a way to form new classes (instances of which are called objects) using classes that have already been defined. The inheritance concept was invented in 1967 for Simula. [ [http://heim.ifi.uio.no/… …   Wikipedia

  • Object (computer science) — In computer science, an object is any entity that can be manipulated by the commands of a programming language, such as a value, variable, function, or data structure. (With the later introduction of object oriented programming the same word,… …   Wikipedia

  • Subclass (computer science) — In object oriented programming, a subclass is a class that inherits some properties from its superclass.You can usually think of the subclass as being a kind of its superclass, as in a a Manx is a kind of cat , or a square is a kind of rectangle …   Wikipedia

  • Superclass — may be:* Superclass (book), A book about World governance by David Rothkopf * Superclass (biology), a taxonomic rank intermediate between subphylum and class. * Superclass (computer science), a class from which other classes are derived *… …   Wikipedia

  • Class (computer science) — In object oriented programming, a class is a programming language construct that is used as a blueprint to create objects. This blueprint includes attributes and methods that the created objects all share.More technically, a class is a cohesive… …   Wikipedia

  • computer programming language — Introduction       any of various languages for expressing a set of detailed instructions for a digital computer. Such instructions can be executed directly when they are in the computer manufacturer specific numerical form known as machine… …   Universalium

  • Class (computer programming) — In object oriented programming, a class is a construct that is used as a blueprint to create instances of itself – referred to as class instances, class objects, instance objects or simply objects. A class defines constituent members which enable …   Wikipedia

  • Method (computer programming) — In object oriented programming, a method is a subroutine (or procedure or function) associated with a class. Methods define the behavior to be exhibited by instances of the associated class at program run time. Methods have the special property… …   Wikipedia

  • Virtual function — In object oriented programming, a virtual function or virtual method is one whose behavior is defined within an inheriting class by a function with the same signature. This concept is a very important part of the polymorphism portion of object… …   Wikipedia

  • Comparison of C Sharp and Java — The correct title of this article is Comparison of C# and Java. The substitution or omission of the # sign is because of technical restrictions. Programming language comparisons General comparison Basic syntax Basic instructions …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”