Why does java doesnot support multiple inheritance?

Answer Posted / rana.ankur

Suppose consider a method funX() which is in class Z.

Suppose a programmer A inherited the class Z to class X and
overrided the funX().So this class will have the new
implementation of funX(). ie class X extend Z
Suppose a programmer D inherited the class Z to class Y and
overrided the funX().So this class will have the new
implementation of funX(). ie class Y extend Z


If Multiple Inheritance is permitted in java, then if the
new programmer C inherited both the classes and he didn't
done any overriding of method funX() then if he calls the
funX() ,the JVM will not know which method to call i.e.,
either the method in class X or method in class Y.

Because of this inconsistencies,Multiple inheritance is not
permitted in java

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is return in java?

743


Explain restrictions for using anonymous inner classes?

844


What is difference between word and integer?

809


How many characters is 16 bytes?

760


What is hashmap in java?

819


Is linkedlist thread safe in java?

780


Why java doesn’t support multiple inheritances?

789


How to call one constructor from the other constructor ?

815


What are the main features of java?

737


What is adapter in java?

716


What is flag in python?

824


What does the “static” keyword mean? Can you override private or static method in java?

827


What is import java util arraylist?

884


What is the driver class?

766


What is class and its types?

784