1.

Which among the following is correct?(a) Abstract functions should not be defined in all the derived classes(b) Abstract functions should be defined only in one derived class(c) Abstract functions must be defined in base class(d) Abstract functions must be defined in all the derived classesI have been asked this question by my school principal while I was bunking the class.The question is from Abstract Function in portion Member Functions & its Types of Object Oriented Programming

Answer»

The correct OPTION is (d) ABSTRACT functions must be defined in all the DERIVED classes

For explanation: The abstract function are only declared in BASE classes and then has to be defined in all the derived classes. This allows all the derived classes to define own definition of any function whose declaration in base CLASS might be common to all the other derived classes.



Discussion

No Comment Found

Related InterviewSolutions