Jump to content

Multiple inheritance

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by JesseMontrose (talk | contribs) at 21:40, 26 July 2001. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

In Object Oriented Programming (OOP), inheritance describes the relationship between two objects. The child inherits features of the parent, allowing for shared functionality. So in the following example:


'Rat' is a child of 'Quadruped Mammal'


Features on 'Quadruped Mammal' (such as "has four legs", "begin walking", or "eat food"), are automatically a part of 'Rat' as well.


If, however, you want to follow totally orthogonal hierarchies simultaneously, such as allowing 'Rat' to inherit from 'Depicted In Cartoon' as well, without Multiple Inheritance you often end up with a very awkwardly mixed hierarchy.


Multiple Inheritance has been a touchy issue for many, with opponents pointing to its increased complexity and ambiguity (if two parents have independant implementations of a feature named X, which one do I inherit?)