1. What is polymorphism in C++? 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. Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
2. 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 Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
3. 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. Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
4. 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. Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
5. Which keyword is used to achieve runtime polymorphism in C++? A. override B. virtual C. final D. polymorphic Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
6. What is the use of the 'virtual' keyword in C++? A. It indicates that a function can be overridden in derived classes. B. It indicates that a function cannot be overridden in derived classes. C. It indicates that a function must be called in the derived class. D. It indicates that a function can be called from anywhere. Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
7. What is the role of a virtual destructor in C++? A. Ensures proper destruction of derived class objects when deleted through a base class pointer. B. Ensures proper destruction of base class objects. C. Ensures proper memory allocation for virtual functions. D. Ensures proper memory alignment for polymorphic objects. Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
8. Which type of polymorphism is achieved by function overriding in C++? A. Compile-time polymorphism B. Run-time polymorphism C. Static polymorphism D. Dynamic polymorphism Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
9. In C++, can a derived class have its own definition of a function that is already defined in the base class? A. Yes B. No C. It depends on the access specifier of the base class function. D. It depends on the data type of the base class function. Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
10. Which type of inheritance is necessary for achieving polymorphism in C++? A. Single inheritance B. Multiple inheritance C. Hierarchical inheritance D. Multilevel inheritance Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board