1.

Where the virtual function should be defined?(a) Twice in base class(b) Derived class(c) Base class and derived class(d) Base classI had been asked this question during an online exam.This interesting question is from Virtual Functions topic in division Member Functions & its Types of Object Oriented Programming

Answer»

The correct CHOICE is (d) BASE CLASS

The best EXPLANATION: The VIRTUAL function should be declared in base class. So that when the derived class inherits from the base class, the functions can be differentiated from the one in base class and another in derived class.



Discussion

No Comment Found

Related InterviewSolutions