Abstract type: Difference between revisions
Content added Content deleted
(Ttypes without instances) |
m (Link to inheritance added) |
||
Line 2: | Line 2: | ||
[[Category:Encyclopedia]] |
[[Category:Encyclopedia]] |
||
[[Category:Object oriented]] |
[[Category:Object oriented]] |
||
'''Abstract type''' is a type without instances. In [[object-oriented programming]] abstract types are used for partial implementation of other types, which are later derived from it. Abstract type may provide implementation of some operations and/or components. Abstract types without any implementation are called '''interfaces'''. In the languages that do not support multiple inheritance ([[Ada]], [[Java]]), interfaces are usually allowed to be multiply inherited from. The languages with multiple inheritance (like [[C++]]), usually make no distinction between partially implementable abstract types and interfaces. |
'''Abstract type''' is a type without instances. In [[object-oriented programming]] abstract types are used for partial implementation of other types, which are later derived from it. Abstract type may provide implementation of some operations and/or components. Abstract types without any implementation are called '''interfaces'''. In the languages that do not support multiple [[inheritance]] ([[Ada]], [[Java]]), interfaces are usually allowed to be multiply inherited from. The languages with multiple inheritance (like [[C++]]), usually make no distinction between partially implementable abstract types and interfaces. |
||
Because the abstract type's implementation is incomplete, if any, it makes no sense to have any instances (objects) of it. Therefore an [[object-oriented programming | OO]] language would prevent creation of such objects. |
Because the abstract type's implementation is incomplete, if any, it makes no sense to have any instances (objects) of it. Therefore an [[object-oriented programming | OO]] language would prevent creation of such objects. |