⟩ What is virtual constructor?
A constructor of a class can not be virtual and if causes a syntax error.
A constructor of a class can not be virtual and if causes a syntax error.
When are the Global objects destroyed? A. When the control comes out of the block in which they are being used. B. When the program terminates. C. When the control comes out of the function in which they are being used. D. As soon as local objects die.
Which of the following implicitly creates a default constructor when the programmer does not explicitly define at least one constructor for a class? A. Preprocessor B. Linker C. Loader D. Compiler
Which of the following gets called when an object goes out of scope? A. constructor B. destructor C. main D. virtual function
Which of the following statement is correct? A. A constructor has the same name as the class in which it is present. B. A constructor has a different name than the class in which it is present. C. A constructor always returns an integer. D. A constructor cannot be overloaded.
Which of the following never requires any arguments? A. Member function B. Friend function C. Default constructor D. const function
Destructor calls are made in which order of the corresponding constructor calls? A. Reverse order B. Forward order C. Depends on how the object is constructed D. Depends on how many objects are constructed
A destructor takes __________ arguments. A. one B. two C. three D. no
It is a __________ error to pass arguments to a destructor. A. logical B. virtual C. syntax D. linker
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