1.

Which among the following is true?(a) Java supports all types of inheritance(b) Java supports multiple inheritance(c) Java doesn’t support multiple inheritance(d) Java doesn’t support inheritanceI had been asked this question in an international level competition.My question is taken from Types of Inheritance topic in chapter Inheritance & its Types of Object Oriented Programming

Answer» RIGHT answer is (c) Java doesn’t support multiple inheritance

Explanation: Java doesn’t support multiple inheritance. This is done to avoid the diamond problem that SOMETIMES arises with inherited FUNCTIONS. Though, multiple inheritance can be IMPLEMENTED in java using interfaces.


Discussion

No Comment Found

Related InterviewSolutions