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
How do you sort in java?
what do you mean by classloader?
Are generics important java?
What is bifunction in java?
What is the history of java?
Define an abstract class with reference to java.
What do you mean by platform independence of Java?
How many bytes is a string?
Why multiple inheritance is not supported by java?
What is object cloning in Java?
What is the difference between a scrollbar and a scrollpane?
what is thread in Java ?
List some oops concepts in java?
What are filterstreams?
How do you check if a character in a string is a digit or letter?