Why does java doesnot support multiple inheritance?
Answer Posted / rathnakar
--> Java follows Super Class Object and Sub Class reference
at runtime to excute inherited and overridden methods.
--> Java doesnot support multiple inheritence by using
classes.becoz java compiler gets ambiguity if one method
is defined in many child classes. this happens due to
above reason
--> so execution fails . but it can be achieved using
interfaces. becoz it method over riding and every child
class is identified uniquely w.rt to interface.
Is This Answer Correct ? | 8 Yes | 0 No |
Post New Answer View All Answers
Does importing a package imports its sub-packages as well in java?
Explain the selection sort algorithm and state its time complexity?
What is struts in java?
Can we have try block without catch block?
What is final, finally, finalize?
Explain the difference between collection api and stream api in java8?
What are the new features in java 8?
how to split string in java?
What are abstract classes and anonymous classes?
What is bigger kb or mb?
What is a class instance variable?
Is null keyword in java?
What is the static field modifier?
How can you make sure that your singleton class will always return single instance in multi-threaded environment?
Can you have two constructors in java?