Why java does not supports multiple inheritance?
Answer Posted / shree
Multiple inheritance eliminated from java because it leads to confusion in many of cases & causes ambiguity.
So to avoid that complexity java does not support multiple inheritance.
/Multiple inheritance program
Class A
{
public void show(){.....}
}
Class B extends A
{
public void show(){.....}
}
Class C extends A{
public void show(){......}
}
Class D extends B,C{ // not supported by java leads to syntax error.
}
Here class D will get confuse which show() method to execute as there are 2 show() methods are available inherited from class B & C.
but to provide functionality of inheritance java provides new concept called INTERFACE.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is return in java?
What is immutability in java?
how many types of Inheritance?
What is a heavyweight component?
Difference between vector and arraylist.
What are namespaces in java?
What is the difference between jdk, jre, and jvm?
What is exception handling in java?
What is 32 bit float?
What is the locale class in java programming?
What is a vector in java?
How to store image in arraylist in java?
What are the differences between getting and load method?
What are the 4 versions of java?
What is the difference between path and classpath variables?