-
please tell me the reasons why java does not support multiple inheritance?0
-
Member • Jul 4, 2015
Try answering this and you will find understand yourself -
If an child will have two father.
Father1 with color white and father2 with color black.
What will be the color of child?Are you sure? This action cannot be undone. -
Administrator • Jul 6, 2015
Because JAVA is a "simple", "object oriented", "distributed", "secure", "multi-threaded", "high performance", "dynamic" language.Kalpanagosaviplease tell me the reasons why java does not support multiple inheritance?Are you sure? This action cannot be undone. -
Member • Jul 6, 2015
Lets consider a Class Test -
Class Test {
public int add ()
{
return 1 ;
}
}
Now Class Test1 and Class Test2 extends class Test
Class Test1 extends Test
{
public int add() --Method add is overridden here
{
return 2;
}
}
Class Test2 extends Test {
public int add() --Method add is overridden here
{
return 3;
}
}
Now consider a Class Test3 extends Test1, Test2
Now which version of method add will be implemented in Class Test3 ?
Will it be with return 3 or with return 2?
This will lead to confusion,right ?
So Java does not support multiple inheritance, means creators of Java does not support multiple inheritance.Are you sure? This action cannot be undone. -
Member • Jul 10, 2015
Thank u!!!Are you sure? This action cannot be undone. -
Member • Jul 12, 2015
Java absolutely support multiple inheritence in terms of Interface.We can extend one class only to avoid ambiguity problem.In interface we have to define the functions.So we don't get any ambiguity.In c++ it is big problem with multiple inheritence but in JAVA this thing is improved by introducing InterfacesAre you sure? This action cannot be undone. -
Member • Jul 18, 2015
tell me difference between Machine code and Native codeAre you sure? This action cannot be undone.