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 difference between classpath and path variables in java?

0 Answers  


What is a Java switch statement, and how can it be used?

2 Answers  


Which java ide is used the most?

0 Answers  


What are MalformedURLException and UnknownHost Exceptions and whey they will be thrown?

2 Answers  


What is the difference between declaration and definition in java?

0 Answers  


whats the life cycle of jsp

15 Answers   Satyam,


I have one Shopping cart application, i that i have selected some items, while clicking submit button by mistake i have clicked twice or trice, that time items are selected twice or trice. Actually i want only one copy of items but its selected twice or trice. So how can we avoid this problem?

2 Answers   Honeywell,


What design pattern you have used in your project? I answered Factory pattern, how it is implemented? What are its advantage? Do know about Abstract Factory?

0 Answers   Bravura Solutions,


What is bool mean?

0 Answers  


How to perform Singleton of the java class object on multi JVM?

2 Answers  


What all access modifiers are allowed for top class ?

0 Answers  


1).what is the difference between below examples String s="vijay"; String s=new String("vijay");

12 Answers   Mascon, Satyam, TCS,


Categories