1.

Which among the following is true?(a) Inheritance must not be using when overriding is used(b) Overriding can be implemented without using inheritance(c) Inheritance must be done, to use overriding are overridden(d) Inheritance is mandatory only if more than one functionsThe question was asked in exam.This question is from Overriding Member Functions in portion Member Functions & its Types of Object Oriented Programming

Answer»

Right option is (C) Inheritance must be DONE, to use overriding are overridden

Best explanation: The inheritance must be used in order to use function overriding. If inheritance is not used, the functions can only be OVERLOADED. There must be a base class and a derived class to override the function of base class.



Discussion

No Comment Found

Related InterviewSolutions