翻訳と辞書 |
Multiple inheritance : ウィキペディア英語版 | Multiple inheritance
Multiple inheritance is a feature of some object-oriented computer programming languages in which an object or class can inherit characteristics and features from more than one parent object or parent class. It is distinct from single inheritance, where an object or class may only inherit from one particular object or class. Multiple inheritance has been a sensitive issue for many years,〔(T. A. (1991) Controversy: The case against multiple inheritance in C++, Computing Systems 4(1) 69-82 )〕〔(J. (1991) Controversy: The Case For Multiple Inheritance in C++. Computing Systems 4(2) 157-171 )〕 with opponents pointing to its increased complexity and ambiguity in situations such as the "diamond problem", where it may be ambiguous as to which parent class a particular feature is inherited from if more than one parent class implements said feature. This can be addressed in various ways, including using virtual inheritance.〔(Traits: Composable Units of Behavior )〕 Alternate methods of object composition not based on inheritance such as mixins and traits have also been proposed to address the ambiguity. == Details ==
In object-oriented programming (OOP), ''inheritance'' describes a relationship between two classes in which one class (the ''child'' class) ''subclasses'' the ''parent'' class. The child inherits methods and attributes of the parent, allowing for shared functionality. For example, one might create a variable class ''Mammal'' with features such as eating, reproducing, etc.; then define a child class ''Cat'' that inherits those features without having to explicitly program them, while adding new features like ''chasing mice''. Multiple inheritance allows programmers to use more than one totally orthogonal hierarchy simultaneously, such as allowing ''Cat'' to inherit from ''Cartoon character'' and ''Pet'' and ''Mammal'' and access features from within all of those classes.
抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Multiple inheritance」の詳細全文を読む
スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース |
Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.
|
|