Review each question and reveal answers to strengthen your understanding
1A constructor that accepts __________ parameters is called the default constructor.
✅ Correct Answer: 3
2What happens when a class with parameterized constructors and having no default constructor is used in a program and we create an object that needs a zero-argument constructor?
✅ Correct Answer: 1
3Destructor has the same name as the constructor and it is preceded by ______ .
✅ Correct Answer: 3
4For automatic objects, constructors and destructors are called each time the objects
✅ Correct Answer: 1
5Which constructor function is designed to copy objects of the same class type?
✅ Correct Answer: 4
6Which of the following statement is correct?
✅ Correct Answer: 3
7Which of the following statement is incorrect?
✅ Correct Answer: 4
8When are the Global objects destroyed?
✅ Correct Answer: 2
9Copy constructor must receive its arguments by __________ .
✅ Correct Answer: 3
10A function with the same name as the class, but preceded with a tilde character (~) is called __________ of that class.
✅ Correct Answer: 2
11
A union that has no constructor can be initialized with another union of __________ type.
✅ Correct Answer: 2
12Which of the following gets called when an object goes out of scope?
✅ Correct Answer: 2
13Which of the following statement is correct?
✅ Correct Answer: 4
14________ used to make a copy of one class object from another class object of the same class type.
✅ Correct Answer: 2
15Constructors __________ to allow different approaches of object construction.
✅ Correct Answer: 2
16Which of the following statement is correct?
✅ Correct Answer: 1
17Which of the following cannot be declared as virtual?
✅ Correct Answer: 4
18If the copy constructor receives its arguments by value, the copy constructor would
✅ Correct Answer: 3
19Which of the following are NOT provided by the compiler by default?
✅ Correct Answer: 4
20
It is a __________ error to pass arguments to a destructor.
✅ Correct Answer: 3
21
If the programmer does not explicitly provide a destructor, then which of the following creates an empty destructor?
✅ Correct Answer: 2
22
A __________ is a constructor that either has no parameters, or if it has parameters, all the parameters have default values
✅ Correct Answer: 1
23
How many default constructors per class are possible?
✅ Correct Answer: 1
24Which of the following statement is correct about destructors?
✅ Correct Answer: 3
25Which of the following statement is correct?
✅ Correct Answer: 1
26Which of the following implicitly creates a default constructor when the programmer does not explicitly define at least one constructor for a class?
✅ Correct Answer: 4
27A destructor takes __________ arguments.
✅ Correct Answer: 4
28Destructor calls are made in which order of the corresponding constructor calls?
✅ Correct Answer: 1
29Which of the following never requires any arguments?
✅ Correct Answer: 3
30
A class's __________ is called when an object is destroyed.
✅ Correct Answer: 2
31Destructors __________ for automatic objects if the program terminates with a call to function exit or function abort.
✅ Correct Answer: 3
32Which of the following statement is correct?
✅ Correct Answer: 4
33
Which of the following statements are correct?
✅ Correct Answer: 2
34How many times a constructor is called in the life-time of an object?
✅ Correct Answer: 1
35
Which of the following gets called when an object is being created?
✅ Correct Answer: 1
36
To ensure that every object in the array receives a destructor call, always delete memory allocated as an array with operator __________ .
✅ Correct Answer: 3
37Which of the following statement is correct about constructors?
✅ Correct Answer: 3
38Which of the following statement is correct whenever an object goes out of scope?