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 |
why static class in java or what is use of static class in java
what is difference between signed & unsigned char?
Can singleton class be inherited in java?
What is constructor in java ?
What is the difference between a constructor and a method?
What kind of variables can a class consist?
What are MalformedURLException and UnknownHost Exceptions and whey they will be thrown?
What are different data types?
How can you set an applet’s height and width as a percentage?
Can we override data members in java?
Can an interface have a class?
What are the parts of methodology?