Polymorphism

From CSSEMediaWiki
Revision as of 04:49, 23 September 2008 by RobertLechte (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Polymorphism is merely the ability of subclasses to act as an instance of their superclass or interface, for instance a Car or Boat instance being used as a Vehicle instance, or a Java class implementing the Comparable interface. This is one of the key underlying purposes of the OO concept.

Polymorphism allows (ideally) the reuse and simplification of objects and their associated code where two objects share a functional role and have similar (but not identical) implementations.

Personal tools