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 |
Explain the access modifiers for a class, method and variables?
which method throws exception of type Throwable
What is method overloading in java ?
What is :: operator in java?
If a method is declared as protected, where may the method be accessed?
What is thread priority?
How many types of methods are there?
What is a percentage sign called?
What is difference between hashset and hashmap in java?
What are different data types?
how can you catch multiple exceptions in java?
How is rounding performed under integer division?