1.

If virtual function of base class is redefined in derived class then ________________(a) It must be declared virtual in derived class also(b) It may or may not be declared virtual in derived class(c) It can must not be declared virtual in derived class(d) It must be declared normally in derived classThis question was addressed to me during an online exam.The doubt is from Virtual Functions in portion Member Functions & its Types of Object Oriented Programming

Answer» CORRECT OPTION is (b) It may or may not be declared virtual in DERIVED class

For explanation: The virtual functions may or may not be declared virtual in derived class. This is because if the overriding function defined in derived class is not declared virtual explicitly, the COMPILER makes it virtual IMPLICITLY.


Discussion

No Comment Found

Related InterviewSolutions