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 a conditional equation?
What is the difference between an object-oriented programming language and object-based programming language?
What is the main purpose of serialization in java?
What are classloaders?
What is data and its types?
What is the main purpose of java?
Write a method that will remove given character from the string?
Give us a program to check for parenthesis matching using stack.
Are private methods final?
Can you pass functions in java?
what is the significance of listiterator in java?
What is object-oriented programming?
What checkbox method allows you to tell if a checkbox is checked?
Explain what access modifiers can be used for methods?
What is function and method in java?