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
How does singleton class work?
Can a source file contain more than one class declaration?
What is the difference between logical data independence and physical data independence?
Is map sorted in java?
Why is static used?
What are the loops in java?
Why can't we make a class private in java?
What is the syntax and characteristics of a lambda expression?
What is the final keyword?
Why Set interface contains unique elements, what internally implemented for this so that it contains unique elements?
Tell me the Importent classes in net package?
Is empty .java file name a valid source file name?
What is nan inf?
Explain what do you mean by functional overloading in java?
What is the use of volatile in java?