11. What is the purpose of using the 'explicit' keyword in front of a constructor declaration in C++? A. To specify the return type of the constructor B. To prevent implicit conversions during object initialization C. To mark the constructor as static D. None of the above 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
12. Which type of constructor is automatically called when an object is created without any arguments in C++? A. Destructor B. Copy constructor C. Default constructor D. Parameterized constructor 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
13. Which of the following statements about destructors in C++ is true? A. Destructors can be overloaded B. Destructors can be inherited C. Destructors are called when an object is created D. Destructors cannot have parameters 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
14. In C++, what is the purpose of the 'this' pointer in a class member function? A. It points to the memory location of the current object instance B. It points to the previous object instance C. It points to the next object instance D. It points to the base class object instance 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
15. Which keyword is used to prevent a class from being inherited in C++? A. sealed B. virtual C. override D. final 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
16. In C++, what is the difference between a shallow copy and a deep copy? A. Shallow copy copies the actual content of the objects, while deep copy copies only the memory addresses B. Shallow copy is faster than deep copy C. Shallow copy copies only the memory addresses of the objects, while deep copy copies the actual content D. Shallow copy is slower than deep copy 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
17. What is the difference between a constructor and a normal member function in C++? A. Constructor can be overloaded, while a member function cannot B. Constructor has a return type, while a member function does not C. Constructor is called explicitly when an object is created, while a member function is called automatically D. Constructor is called automatically when an object is created, while a member function needs to be called explicitly 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
18. What happens if a class does not define any constructors in C++? A. The class will have a compilation error B. The class cannot be compiled C. A default constructor is automatically provided D. The class cannot have any objects instantiated 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
19. What is the purpose of the 'static' keyword in C++ class members? A. To hide the implementation details of a class B. To initialize objects of a class C. To create a single copy of the member shared by all objects D. To create multiple instances of a class 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
20. What is the purpose of the destructor in C++? A. To initialize objects B. To create objects C. To release resources acquired by the object D. To access class members 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