911. Which of the following gets called when an object is being created?
A. Constructor
B. Virtual Function
C. Destructors
D. Main

912. Destructor has a same name as the constructor and it is preceded by?
A. !
B. ?
C. ~
D. $

913. Like constructors, can there be more than one destructors in a class?
A. Yes
B. No
C. May Be
D. Can’t Say

914. Which of the following is true about constructors. i) They cannot be virtual ii) They cannot be private. iii) They are automatically called by new operator.
A. All i,ii,iii
B. i & iii
C. ii & iii
D. i & ii

915. Destructors __________ for automatic objects if the program terminates with a call to function exit or function abort
A. Are called
B. Are not called
C. Are inherited
D. Are created

916. Which constructor function is designed to copy object of same class type?
A. Copy constructor
B. Create constructor
C. Object constructor
D. Dynamic constructor

917. 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

918. which of this can not be declared as virtual
A. Constructor
B. Destructor
C. Both A & B
D. None of the above

919. We must use initializer list in a constructor when
A. There is a reference variable in class
B. There is a constant variable in class
C. There is an object of another class. And the other class doesn’t have default constructor
D. All of the above

920. 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

Leave a Reply