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
What is identifier give example?
How many unicode characters are there?
What are 3 boolean operators?
Define max and min heap, also the search time of heap.
what are the methods in object?
What are constants and how to create constants in java?
Can a lock be acquired on a class in java programming?
How do generics work?
How many types of interfaces are there?
How to remove the trailing spaces from a string?
Explain about anonymous inner classes ?
What are the important features of Java 9 release?
What is meant by string is immutable?
Why do we use variables?
What is jvm? How its run?