1.

It is __________ to redefine the virtual function in derived class.(a) Necessary(b) Not necessary(c) Not acceptable(d) Good practiceThis question was posed to me in an interview.My question comes from Virtual Functions in portion Member Functions & its Types of Object Oriented Programming

Answer»

Correct answer is (b) Not necessary

For explanation: It is not necessary to redefine the virtual FUNCTION in the derived class. If not defined, the base class function definition is USED but if defined, the intended definition is used ACCORDING to need. It is not about good coding PRACTICE as it should be REDEFINED only if needed.



Discussion

No Comment Found

Related InterviewSolutions