How java supports inheritance and is java supports multiple inheritance, if so what about c++

Showing Answers 1 - 2 of 2 Answers

Hi,

        Java doesn't support mulitple inheritance, it support single implementation inheritance. Object class is the super class of all the classes in java so when we create any class then it implicitly extends the Object class and when we extend with another class then it becomes the subclass of that class and that class would be the subclass  of Object class it also becomes the subclass of Object class but indirectly or you can say it is multilevel inheritance. Since java doesn't support multiple inheritance means we can extend only one class at single implementation but we can implements multiple interfaces at single implementation so you can say it is the solution of multiple inheritance in java but C++ supports multiple inheritance. 

Abhishek(Sharad)

  Was this answer useful?  Yes

ramesh chandra

  • Jan 2nd, 2007
 

hi every body

java doesn't supports multiple inheritance .It supports via the interface implementation

what actually means multiple inheritance:

suppose class & sub classes use same type of function names and atlast when u call in the  main method it becomes probelm with duplicate function names and doesn't know which has to be called

if any mistake forgive me and send me a  mail it is as per my knowledge is concerned

thanks & regards

ramesh chandra

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions