1.

Virtual functions are mainly used to achieve _____________(a) Compile time polymorphism(b) Interpreter polymorphism(c) Runtime polymorphism(d) Functions code polymorphismI had been asked this question during an interview for a job.Question is from Virtual Functions topic in portion Member Functions & its Types of Object Oriented Programming

Answer»

Right answer is (C) Runtime POLYMORPHISM

Best explanation: It is used to achieve runtime polymorphism. The functions which are inherited and OVERRIDDEN, so at runtime the correct function is executed. The correct function call is made from the INTENDED class.



Discussion

No Comment Found

Related InterviewSolutions