MCQ - Constructor And Destructor in C++ Programming

17.Can destuctors be private in C++?

A. Yes
B. No

View Answer

18. Allocation of memory to objects at the time of their construction is known as ……………. of objects.

A. Run time construction
B. Dynamic Construction
C. Initial Construction
D. Staic Construction

View Answer

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

View Answer

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

View Answer

21.constructor _______ to allow different approaches of object construction

A. Cannot overloaded
B. Can be overloaded
C. Can be called
D. Can be nested

View Answer

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

View Answer

23.Whenever const objects try to invoke non-const member functions, the compiler …………………

A. Return zero value
B. Return Null
C. Generate error
D. Return no Value

View Answer

24.When a copy constructor may be called?

A. When an object of the class is returned by value
B. When an object of the class is passed (to a function) by value as an argument.
C. Both A & B
D. None of the above

View Answer

Also check :


* You must be logged in to add comment.