1.

How many base classes can a single class inherit in java?(a) 1(b) 2(c) 3(d) As many as requiredThis question was addressed to me during an online exam.The origin of the question is Base Class in division Classes of Object Oriented Programming

Answer»

Right option is (a) 1

Explanation: In java, multiple inheritance is not SUPPORTED, which LEADS to the FACT that a class can have only 1 parent class if inheritance is used. Only if interfaces are used then the class can implement more than one base class.



Discussion

No Comment Found

Related InterviewSolutions