What is the reason that multiple inheritance is not possible
in java??



What is the reason that multiple inheritance is not possible in java??..

Answer / gayathri

This is to avoid "Diamond problem"....Lets say there are 4 classes A,B,C,D..A is a superclass...The two classes B and C inherit from A, and class D inherits from both B and C. If a method in D calls a method defined in A (and does not override the method), and B and C have overridden that method differently, then from which class does it inherit: B, or C? ...To avoid this issue, Java dint allow multiple inheritance..
Having said that, also note that Java allows multiple inheritance through multiple interface implementation

Is This Answer Correct ?    10 Yes 1 No

Post New Answer

More Core Java Interview Questions

What is anti pattern in java?

0 Answers  


Which java version is latest?

0 Answers  


List down the methods and interfaces of collection class in java.

0 Answers  


How do I find and replace in word?

0 Answers  


What is logical variable?

0 Answers  






What is substring of a string?

1 Answers  


Explain naming conventions for packages?

0 Answers  


How to do validation of the fields in any project ?

2 Answers  


Can a private method be declared as static?

0 Answers   Global Logic,


Which is bigger float or double java?

0 Answers  


How to sort elements in a parallel array in java?

0 Answers  


Have you used any version control ? if so explain about it?

2 Answers  


Categories