Is multiple inheritance allowed in Java? Why ?

Answer Posted / shivaprasad

Multiple inheritance is not allowed in java because it creates
DIAMOND PROBLEM.
DIAMOND PROBLEM: Suppose classes B and C extend A and
class D extends to both B and C(multiple inheritance). Now,
if D calls a method in A then it does not know from which
class it has to inherit(either B or C). This is called
diamond problem.

Is This Answer Correct ?    8 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is deadlock? : Java thread

726


Does java allow default arguments?

769


How to sort numbers in java without array?

729


Is passing by reference faster?

751


What is treeset in java collection?

742


Do we have pointers in java?

708


What are the differences between string, stringbuffer and stringbuilder?

730


I don’t want my class to be inherited by any other class. What should I do?

782


What is a get method?

720


Can list contain null in java?

868


Difference between operator overloading and function overloading

814


List primitive java types?

777


What is a type parameter in java?

738


What is volatile keyword in java

870


difference between byte stream class and character stream class?

4296