Summary
Multiple inheritance is a feature of some object-oriented computer programming languages in which an object or class can inherit 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 controversial issue for many years, 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. Alternate methods of object composition not based on inheritance such as mixins and traits have also been proposed to address the ambiguity. 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. Languages that support multiple inheritance include: C++, Common Lisp (via Common Lisp Object System (CLOS)), EuLisp (via The EuLisp Object System TELOS), Curl, Dylan, Eiffel, Logtalk, Object REXX, Scala (via use of mixin classes), OCaml, Perl, POP-11, Python, R, Raku, and Tcl (built-in from 8.6 or via Incremental Tcl (Incr Tcl) in earlier versions). IBM System Object Model (SOM) runtime supports multiple inheritance, and any programming language targeting SOM can implement new SOM classes inherited from multiple bases.
About this result
This page is automatically generated and may contain information that is not correct, complete, up-to-date, or relevant to your search query. The same applies to every other page on this website. Please make sure to verify the information with EPFL's official sources.
Related publications (7)

Cross-Platform Language Design

Sébastien Jean R Doeraene

Programming languages are increasingly compiled to multiple runtimes, each featuring their own rich structures such as their object model. Furthermore, they need to interact with other languages targe
EPFL2018
Show more
Related concepts (49)
Object-oriented programming
Object-Oriented Programming (OOP) is a programming paradigm based on the concept of "objects", which can contain data and code. The data is in the form of fields (often known as attributes or properties), and the code is in the form of procedures (often known as methods). A common feature of objects is that procedures (or methods) are attached to them and can access and modify the object's data fields. In this brand of OOP, there is usually a special name such as or used to refer to the current object.
Multiple inheritance
Multiple inheritance is a feature of some object-oriented computer programming languages in which an object or class can inherit 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 controversial issue for many years, 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.
Ruby (programming language)
Ruby is an interpreted, high-level, general-purpose programming language which supports multiple programming paradigms. It was designed with an emphasis on programming productivity and simplicity. In Ruby, everything is an object, including primitive data types. It was developed in the mid-1990s by Yukihiro "Matz" Matsumoto in Japan. Ruby is dynamically typed and uses garbage collection and just-in-time compilation. It supports multiple programming paradigms, including procedural, object-oriented, and functional programming.
Show more
Related courses (11)
PENS-222: The land of a thousand dances
Considérons l'acte d'entretenir comme un potentiel de projet : observons les usages et les usures qui en découlent pour développer et réaliser des interventions permettant de conforter, adapter, suppr
MATH-458: Programming concepts in scientific computing
The aim of this course is to provide the background in scientific computing. The class includes a brief introduction to basic programming in c++, it then focus on object oriented programming and c++ s
CS-112(g): Object oriented programming
Ce cours approfondit les connaissances en programmation présentées dans le cours ICC du 1er semestre. L'accent est mis sur l'approche «orientée objet» (en C++), la conception et la spécification de pr
Show more
Related lectures (118)
Multiple Inheritance in C++
Explores the challenges and solutions of multiple inheritance in C++ through code examples and compilation explanations.
Multiple Inheritance: Concepts and Examples
Covers defining independent concepts in classes and creating more complex classes through inheritance.
Virtual Methods in C++
Covers polymorphism in C++ through virtual methods, explaining method resolution and the interaction with constructors.
Show more
Related MOOCs (3)
Projet de programmation en java
The purpose of this MOOC is to offer a complementary capstone project to our existing MOOCs in introduction to programming. This will offer the students the possibility to both stabilize the already a
Introduction to Object-Oriented Programming in Java
Le cours suivi propose une introduction aux concepts de base de la programmation orientée objet tels que : encapsulation et abstraction, classes/objets, attributs/méthodes, héritage, polymorphisme, ..
Introduction to Object-Oriented Programming in C++
Le cours suivi propose une introduction aux concepts de base de la programmation orientée objet tels que : encapsulation et abstraction, classes/objets, attributs/méthodes, héritage, polymorphisme, ..