Cpp : Constructors And Destructors 14

C++ Programming Multiple Choice Questions – Constructor And Destructor

This section focuses on the “Constructor And Destructor” in C++ programming langauge. These Multiple Choice Questions (MCQ) should be practiced to improve the C++ programming skills required for various interviews (campus interview, walk-in interview, company interview), placement, entrance exam and other competitive examinations.

Which of the following is/are automatically added to every class, if we do not write our own.

A. Copy Constructor.
B. Assignment Operator
C. A constructor without any parameter
D. All of the above

Which of the following gets called when an object is being created?

A. Constructor
B. Virtual Function
C. Destructors
D. Main

Destructor has the same name as the constructor and it is preceded by?

A. !
B. ?
C. ~
D. $

Like constructors, can there be more than one destructors in a class?

A. Yes
B. No
C. May Be
D. Can’t Say

State whether the following statements about the constructor are True or False.
i) constructors should be declared in the private section.
ii) constructors are invoked automatically when the objects are created.

A. True,True
B. True,False
C. False,True
D. False,False