why java does not support multiple inheritance
Answer Posted / sreekanta paul
In C++ when a subclass inherits a superclass then the name of superclass is specified.But in java it is quite confusing from which superclass a method will be inherited by the subclass.Suppose wo 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?
Thats why in java the concept of Interface came to solve this problem.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are implicit objects in java?
How do I compare two strings in word in java?
What do you mean by local class?
Explain where variables are created in memory?
What is Recursion Function?
Can a constructor call another constructor?
What is difference between core java and java ee?
How will you print number in reverse (descending) order in BST.
Why synchronization is important?
What's the purpose of static methods and static variables?
What is an enumeration?
What does += mean coding?
Tell me a few examples of final classes defined in Java API?
What is the technique adopted to create an immutable class?
What is jagged array in java?