What is the reason that multiple inheritance is not possible
in java??
Answer Posted / 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 View All Answers
Hi friends am new to java. I read jar file means collection of java files. For executing struts application what are the necessary jar files. " struts.jar " file contains what. can u explain
Is stringwriter thread safe?
What is the use of coding?
Where are the local variables stored?
What are multiple inheritances?
What do you mean by synchronized non access modifier?
How are the elements of a gridbaglayout organized in java programming?
Can we store variables in local blocks?
How is garbage collection controlled?
How many types of parsers are there?
Why are getters and setters used?
I want to re-reach and use an object once it has been garbage collected. Define how it’s possible?
Which is bigger float or double java?
Can bool be null?
How does thread synchronization occurs inside a monitor? What levels of synchronization can you apply?