1.

How compile-time polymorphisms are implemented in C++?(a) Using Inheritance(b) Using Virtual functions(c) Using Templates(d) Using Inheritance and Virtual functionsThe question was posed to me during an online interview.I'm obligated to ask this question of OOPs Concept in chapter Basics Concepts of C++ of C++

Answer»

Correct option is (c) Using Templates

Explanation: Compile-time polymorphism is IMPLEMENTED using templates in which the TYPES(which can be checked during compile-time) are USED DECIDES which function to be called.



Discussion

No Comment Found

Related InterviewSolutions