Anonymous

Why In Java Is Multiple Inheritance Is Not Supported?

3

3 Answers

Akshay Kalbag Profile
Akshay Kalbag answered
The question whether Java supports multiple inheritance or not can simply be answered as both yes and no. In fact, Java separates implementation inheritance from interface inheritance. Interface inheritance deals with the contract to which a class adheres. On the other hand, implementation inheritance deals with both the reuse of the code and the contract to which a class adheres.

Java only permits the multiple inheritances of interfaces and the single inheritances of implementation. It is different from other programming languages such as C++ where both the concepts are intermingled, which makes them unnecessary complicated. Java is a simpler programming language than other programming languages such as C++. This is because in Java, the concepts of interface inheritances and implementation inheritances are not intermingled. Since the Java programming language does not support multiple inheritance, it allows a class to extend more than one class of bases. Multiple interfaces are similar to multiple inheritances.
Anonymous Profile
Anonymous answered
Hi... As we all know we can implement multiple interfaces in java,but only single inheritance.as I think that is because in interfaces there is not a method body so no problem occurs when implementing more than one interfaces,but when inhering from another class  problems occur when using multiple inheritance since there can be a method body in the super classes(if we didnt override and just call a metode of super class if that method defined in more than one super classes there will be a problem)
Arun kumar Profile
Arun kumar answered
Let us assume to classes named class a and class b, and both the class have the same method named as meth()... Java is a simpler language.. If Java support multiple inheritance there will be a confusion persist to JVM during runtime if class a and class b is inherit in a single class. That is which method will be inherit in that class.. So Java not support multiple inheritance...

Answer Question

Anonymous