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


Please Help Members By Posting Answers For Below Questions

Does importing a package imports its sub-packages as well in java?

769


Explain the selection sort algorithm and state its time complexity?

831


What is struts in java?

823


Can we have try block without catch block?

815


What is final, finally, finalize?

810


Explain the difference between collection api and stream api in java8?

746


What are the new features in java 8?

822


how to split string in java?

888


What are abstract classes and anonymous classes?

871


What is bigger kb or mb?

810


What is a class instance variable?

864


Is null keyword in java?

744


What is the static field modifier?

845


How can you make sure that your singleton class will always return single instance in multi-threaded environment?

803


Can you have two constructors in java?

715