Jump to content

Interface inheritance

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 68.59.8.30 (talk) at 16:02, 15 February 2006. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

In object-oriented programming, interface inheritance is type of inheritance wherein one or more classes share a set of messages. This sharing can be realized by agreement, as in Python, or by use of programming-languge-specific machinery, as in Java.

Interface inheritance is considered the most important aspect of inheritance. It is often conflated with the notion of implementation inheritance in the object-oriented programming paradigm. There is, however, a subtle, but notable difference: the latter is less flexible than the former, as it is unamiable to encapsulation.

In Java, this is the mechanism used when multiple inheritance is desired. Since Java does not support multiple inheritance, the implementation of multiple interfaces allows it to satisfy the "is-a" relationship for multiple "super"classes.

See also