Question d’entretien chez Thinkitive Technologies

Why multiple inheritance is not allowed in java

Réponse à la question d'entretien

Utilisateur anonyme

1 juill. 2024

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.