Class hierarchy
Aclass hierarchyorinheritance treeincomputer scienceis a classification ofobjecttypes, denoting objects as the instantiations ofclasses(class is like a blueprint, the object is what is built from that blueprint) inter-relating the various classes by relationships such as "inherits", "extends", "is an abstraction of", "an interface definition".[1]Inobject-oriented programming,a class is a template that defines the state and behavior common to objects of a certain kind. A class can be defined in terms of other classes.[1]
The concept of class hierarchy in computer science is very similar totaxonomy,the classifications of species.
The relationships are specified in the science ofobject-oriented designand object interface standards defined by popular use, language designers (Java,C++,Smalltalk,Visual Prolog) and standards committees for software design like theObject Management Group.
The class hierarchy can be as deep as needed. The instance variables and methods are inherited down through the levels and can be redefined according to the requirement in a subclass. In general, the further down in the hierarchy a class appears, the more specialized its behavior. When a message is sent to an object, it is passed up the inheritance tree starting from the class of the receiving object until a definition is found for the method. This process is called upcasting.
See also
[edit]References
[edit]- ^ab"OOP: Class Hierarchy".staff.fnwi.uva.nl.Retrieved2017-10-11.