+ 1
Why Java do not support multiple inheritance
Why Java do not support multiple inheritance? and what are the ways to do.
3 Answers
+ 10
Ways to do: interfaces.
Why is doesn't: naming reasons, meaning uniqueness of methods ;)
+ 5
\\Java doesn't support multiple inheritance
Class A
{
public void B()
{
}
}
Class C
{
public void B()
{
}
}
Class D extends A,C
{
\\now class D don't know from which class it has to call the method B(). because both extended classes have same method B().
\\This creates ambiguity.
}
To support multiple inheritance Java uses concept of interfaces and many more.
Hope this will clear your doubt.