How Multiple Inheritance Is Possible in C

Multiple inheritance occurs when a class inherits from more than one base class. So the class can inherit features from multiple base classes using multiple inheritance. This is an important feature of object oriented programming languages

Where multiple inheritance is possible?

Multiple inheritance using interfaces In case of multiple interfaces with the same default method. In the concrete class implementing both interfaces, you can implement the common method and call both super methods. thus You can achieve multiple inheritance in Java using interfaces.

Why multiple inheritance is not possible?

The reason behind this is to prevent ambiguity. Consider a case where class B extends class A and Class C and both class A and C have the same method display(). Now java compiler cannot decide, which display method it should inherit. To prevent such situation, multiple inheritances is not allowed in java.

Alexander Ross

Alexander Ross

Gaming, Esports & Interactive Media Writer

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.

Share this article
Twitter Facebook Pinterest