adspace
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
Differentiate between static and non-static methods in java.
Write a program to print count of empty strings in java 8?
explain different ways of using thread? : Java thread
Write a program to find the whether a number is an Armstrong number or not?
Realized?
What is an object in java and how is it created?
What is a classloader in java?
What is java string pool?
Explain public static void main(string args[]) in java.
What is the difference between break and continue statements?
Write a java program to find the route that connects between Red and Green Cells. General Rules for traversal 1. You can traverse from one cell to another vertically, horizontally or diagonally. 2. You cannot traverse through Black cells. 3. There should be only one Red and Green cell and at least one of each should be present. Otherwise the array is invalid. 4. You cannot revisit a cell that you have already traversed. 5. The maze need not be in the same as given in the above example
What is the difference between equals() and == in java?
What are the differences between heap and stack memory in java?
What is parsing in java?
What is a constructor overloading in java?