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 |
What is main difference between variable and constant?
Why enumeration is faster than iterator?
What are thread safe functions?
what is mean by ooad? where we are using? can you tell me any real time example?
Can you start a thread twice in Java?
What is tostring () method?
What do you mean by access modifier?
How to retrieve data from database in java using arraylist?
how do I create a runnable with inheritance? : Java thread
What is clipping?
what is deadlock? : Java thread
What is the use of singleton class?