1.

If single level inheritance is used and an abstract class is created with some undefined functions, can its derived class also skip some definitions?(a) Yes, always possible(b) Yes, possible if only one undefined function(c) No, at least 2 undefined functions must be there(d) No, the derived class must implement those methodsThe question was posed to me during an online interview.I would like to ask this question from Single Level Inheritance in chapter Inheritance & its Types of Object Oriented Programming

Answer»

The correct ANSWER is (d) No, the derived CLASS MUST implement those methods

The best explanation: The derived class must implement those methods. This is because the parent class is abstract and hence will have some undefined functions which has to be defined in derived classes. Since we are using single level inheritance, if derived class doesn’t implement those functions then one more class has to be there which will BECOME multi-level inheritance.



Discussion

No Comment Found

Related InterviewSolutions