1.

Exactly same declaration in base and derived class includes______________(a) Only same name(b) Only same return type and name(c) Only same return type and argument list(d) All the same return type, name and parameter listI had been asked this question in an international level competition.Origin of the question is Overriding Member Functions in section Member Functions & its Types of Object Oriented Programming

Answer»

The correct answer is (d) All the same return type, NAME and parameter list

Explanation: Declaration includes the WHOLE prototype of the FUNCTION. The return type name and the parameter list must be same in order to CONFIRM that the function is same in derived and the base class. And hence can be overridden.



Discussion

No Comment Found

Related InterviewSolutions