1.

If virtual functions are defined in the base class then _______________(a) It is not necessary for derived classes to override those functions(b) It is necessary for derived classes to override those functions(c) Those functions can never be derived(d) Those functions must be overridden by all the derived classesI had been asked this question during an interview.This interesting question is from Overriding Member Functions in division Member Functions & its Types of Object Oriented Programming

Answer»

Correct choice is (a) It is not necessary for DERIVED CLASSES to override those functions

To explain I would say: The derived classes doesn’t have to REDEFINE and override the base class functions. If one DEFINITION is already given it is not mandatory for any derived class to override those functions. The base class definition will be used.



Discussion

No Comment Found

Related InterviewSolutions