⟩ Which of the following gets called when an object is being created? A. constructor B. virtual function C. destructor D. main
Option A
constructor
Option A
constructor
If the programmer does not explicitly provide a destructor, then which of the following creates an empty destructor? A. Preprocessor B. Compiler C. Linker D. main() function
__________ used to make a copy of one class object from another class object of the same class type. A. constructor B. copy constructor C. destructor D. default constructor
A function with the same name as the class, but preceded with a tilde character (~) is called __________ of that class. A. constructor B. destructor C. function D. object
Constructors __________ to allow different approaches of object construction. A. cannot overloaded B. can be overloaded C. can be called D. can be nested
A union that has no constructor can be initialized with another union of __________ type. A. different B. same C. virtual D. class
Which of the following statement is correct? A. A destructor has the same name as the class in which it is present. B. A destructor has a different name than the class in which it is present. C. A destructor always returns an integer. D. A destructor can be overloaded.
A __________ is a constructor that either has no parameters, or if it has parameters, all the parameters have default values. A. default constructor B. copy constructor C. Both A and B D. None of these
If the copy constructor receives its arguments by value, the copy constructor would A. call one-argument constructor of the class B. work without any problem C. call itself recursively D. call zero-argument constructor
How many default constructors per class are possible? A. Only one B. Two C. Three D. Unlimited
Which of the following cannot be declared as virtual? A. Constructor B. Destructor C. Data Members D. Both A and C