Why does java doesnot support multiple inheritance?

Answer Posted / rana.ankur

Suppose consider a method funX() which is in class Z.

Suppose a programmer A inherited the class Z to class X and
overrided the funX().So this class will have the new
implementation of funX(). ie class X extend Z
Suppose a programmer D inherited the class Z to class Y and
overrided the funX().So this class will have the new
implementation of funX(). ie class Y extend Z


If Multiple Inheritance is permitted in java, then if the
new programmer C inherited both the classes and he didn't
done any overriding of method funX() then if he calls the
funX() ,the JVM will not know which method to call i.e.,
either the method in class X or method in class Y.

Because of this inconsistencies,Multiple inheritance is not
permitted in java

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is map in java?

759


How do you sort an array in java?

796


What is equlas() and hashcode() contract in java? Where does it used?

853


These static constructors are correct ? class A { statc intA() { } static A(int x,int y) { } static A(int x) { } }

832


what is mena by object block any what is the use of that

2007


What are encapsulation, inheritance and polymorphism?

753


What is foreach loop in java?

781


What is the method in java?

862


Can a class with private constructor be extended?

725


What is oop principle in java?

771


v-model life cycle

1841


What is the difference between preemptive scheduling and time slicing?

853


Difference between collection, collection and collections in java?

823


What is arraylist e in java?

767


What are thread groups?

781