why java does not support multiple inheritance
Answer Posted / mahesh patil
Suppose consider a method aaa() which is in class Z.
Suppose a programmer ABC inherited the class Z to class X
and overrided the aaa().So this class will have the new
implementation of aaa().
Suppose a programmer DEF inherited the class Z to class Y
and overrided the aaa().So this class will have the new
implementation of aaa().
If Multiple Inheritance is permitted in java, then if the
new programmer inherited both the classes and he didn't done
any overriding of method aaa() then if he calls the aaa()
,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 ? | 1 Yes | 1 No |
Post New Answer View All Answers
Lowest Common ancestor in a Binary Search Tree and Binary Tree.
What is methods and methodology?
What are the differences between wait() and sleep()?
What is the purpose of the return statement?
What are constants and how to create constants in java?
Why wait and notify methods are declared in object class?
What is codebase?
How do I stop concurrentmodificationexception?
What is size_t?
What is a programming object?
What is a flag value?
Is list ordered in java?
What is a singleton factory?
what is heap memory?
What is math floor in java?