Which keyword is used to achieve runtime polymorphism in C++?
A. override
B. virtual
C. final
D. polymorphic
Answer: Option B
A. A feature that allows objects of different classes to have the same name.
B. A feature that allows functions to perform different tasks based on the object they are called with.
C. A feature that allows the same function to have different implementations.
D. A feature that allows inheritance of multiple classes.
Which type of polymorphism is achieved by function overloading in C++?
A. Compile-time polymorphism
B. Run-time polymorphism
C. Static polymorphism
D. Dynamic polymorphism
What is dynamic polymorphism in C++?
A. Achieved through function overloading.
B. Achieved through function overriding.
C. Achieved using pointers or references to base class objects.
D. Achieved through template functions.
How is polymorphism implemented in C++?
A. By defining multiple functions with the same name but different parameters.
B. By using function pointers.
C. By using virtual functions.
D. By defining multiple classes with the same name.
Join The Discussion