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 |
When should a function throw an exception?
0 Answers Thomson Reuters, Virtusa,
can we write a program with out a class in core java?
What is enhanced loop in java?
When will you define a method as static in Java?
0 Answers SwanSoft Technologies,
What is logical variable?
What is map and hashmap? also tell the difference.
What is parsing in grammar?
What do you understand by classes in java?
how to handle exceptions in core applications?
What are parsers? Dom vs sax parser.
What data type is string java?
What is the access scope of a protected method?