Virtual Functions and Dynamic Binding – MCQs

30 Score: 0 Attempted: 0/30 Subscribe
1. : What is the primary purpose of a virtual function in C++?
 
2. : What keyword is used to declare a virtual function in C++?
 
3. : Which type of function is resolved at runtime in C++?
 
4. : Which type of binding does a virtual function implement?
 
5. : Where is the virtual table (vtable) created?
 
6. : What must be present in the base class for dynamic binding to occur?
 
7. : Which of the following does NOT support dynamic binding?
 
8. : What happens if a virtual function is not overridden in the derived class?
 
9. : What is dynamic polymorphism achieved through in C++?
 
10. : What type of function can be declared virtual?
 
11. : Can a constructor be virtual in C++?
 
12. : Which mechanism allows calling the appropriate function version using a base class pointer?
 
13. : What ensures that destructors are properly called in a class hierarchy?
 
14. : Can a destructor be virtual in C++?
 
15. : What is the benefit of virtual destructors?
 
16. : What is the default behavior of a virtual function?
 
17. : How do you make a class abstract in C++?
 
18. : What is the syntax for a pure virtual function?
 
19. : What happens if an abstract class is instantiated?
 
20. : What is the correct term for “virtual functions resolved at runtime”?
 
21. : In which memory area is the virtual table stored?
 
22. : Which one is true about virtual tables?
 
23. : What determines the function called in dynamic binding?
 
24. : What happens if a virtual function is called in a constructor?
 
25. : What keyword is used to prevent further overriding of a virtual function?
 
26. : Can virtual functions be private?
 
27. : Which feature of OOP uses virtual functions?
 
28. : What is a vtable pointer called in C++ objects?
 
29. : What must be the return type of a virtual function?
 
30. : Which of the following can’t be virtual?
 

Leave a Comment

All copyrights Reserved by MCQsAnswers.com - Powered By T4Tutorials