Why is multiple inheritances not supported in Java ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why is multiple inheritances not supported in Java ?

12th Mar 2018, 3:03 PM
Girish Nagar
Girish Nagar - avatar
3 Answers
+ 7
Multiple inheritance can cause the diamond problem. What is the diamond problem? https://en.m.wikipedia.org/wiki/Multiple_inheritance#The_diamond_problem Since Java 8, the diamond problem can still exist via interfaces. However, it is what likely influenced the decision by developers to not make the language support multiple inheritance.
12th Mar 2018, 3:51 PM
Rrestoring faith
Rrestoring faith - avatar
+ 3
makes java easier to understand im sure you can do this in c++
12th Mar 2018, 3:11 PM
D_Stark
D_Stark - avatar
+ 1
The main point to be discussed over here is Java does not support multiple inheritance or Java does support? There are lots of people who are still under confusion that it supports but actually it does not support using interface in Java. Even the father of Java has once admitted the fact. Most of the developers actually projected a false story about the support of multiple inheritance. When compared to concrete classes interface gives flexibility and using single class multiple interfaces can be implemented. With the help of this you actually get closer to multiple inheritance. The main thing actually done is implementing multiple interfaces and that is not to be done in terms of extending anything or inheriting anything. For including the behaviors and properties of implementing the class there is no free seeking of implementation from parent classes. Read here in detail:- http://crbtech.in/Java-Training/java-doesnt-support-multiple-inheritance/
13th Mar 2018, 5:58 AM
pranit patil
pranit patil - avatar