Jump to content

Hierarchy (object-oriented programming)

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Antonielly (talk | contribs) at 12:42, 15 November 2008 (Merge proposal). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

In computer science's object-oriented programming, the mapped relationships of sub- and superclasses is known as a hierarchy. This can be visualized as an upside-down tree (or perhaps a pyramid), the top of which is known as the root. An exception is C++, where no single root class exists. The issue is more complicated with languages that support multiple inheritance, where hierarchy can be any directed acyclic graph.

Aggregation or Composition relationships in object-oriented design also form a hierarchy, composition hierarchy.

Hierarchy in Java

The root of the java class hierarchy is the Object class (implemented in the file Object.class).

See also