1.

The functions to be overridden _____________(a) Must be private in base class(b) Must not be private base class(c) Must be private in both derived and base class(d) Must not be private in both derived and base classThe question was asked in an online interview.I'd like to ask this question from Overriding Member Functions in division Member Functions & its Types of Object Oriented Programming

Answer»

The CORRECT ANSWER is (b) Must not be PRIVATE base class

For explanation: If the FUNCTION is private in the base class, derived class won’t be able to access it. When the derived class can’t access the function to be overridden then it won’t be able to override it with any definition.



Discussion

No Comment Found

Related InterviewSolutions