11. What happens if a virtual function is not overridden in the derived class in C++? A. Compilation error B. Run-time error C. No error, the base class function is called. D. No error, the derived class function is called. 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
12. What is function overloading in C++? A. Defining multiple functions with the same name but different parameters. B. Defining multiple functions with the same name and same parameters. C. Defining a function that can accept multiple data types. D. Defining a function inside another 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
13. What is compile-time polymorphism in C++? A. Polymorphism resolved during compile time. B. Polymorphism resolved during runtime. C. Polymorphism resolved during linking. D. Polymorphism resolved during execution. 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
14. In C++, can a function be both virtual and static at the same time? A. Yes B. No C. Yes, but only for member functions. D. Yes, but only for non-member functions. 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
15. Which of the following is not a type of polymorphism in C++? A. Parametric polymorphism B. Ad-hoc polymorphism C. Compile-time polymorphism D. Run-time 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
16. What is the purpose of a pure virtual function in C++? A. It forces derived classes to implement the function. B. It prevents derived classes from implementing the function. C. It allows the base class to override the derived class's function. D. It allows multiple inheritance. 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
17. How is polymorphism different from overloading in C++? A. Polymorphism involves different implementations of the same function name. B. Overloading involves multiple functions with the same name but different parameters. C. Polymorphism is resolved at compile time, while overloading is resolved at runtime. D. Polymorphism is a feature of C++ while overloading is a feature of Java. 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
18. What is the concept of function overriding in C++? A. It involves a derived class defining a function that redefines a base class function. B. It involves a base class defining a function that is already defined in the derived class. C. It involves multiple functions with the same name but different implementations. D. It involves calling a function multiple times within the same scope. 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
19. Which keyword is used to prevent further inheritance of a class in C++? A. sealed B. final C. restrict D. abstract 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
20. What is the role of the 'virtual' keyword in function declaration in C++? A. It indicates that the function can be accessed globally. B. It indicates that the function can be overridden in derived classes. C. It indicates that the function is immutable. D. It indicates that the function has no return type. 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