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.
1.
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
2.
Which of the following gets called when an object is being created?
A. Constructor
B. Virtual Function
C. Destructors
D. Main
3.
Destructor has the same name as the constructor and it is preceded by?
A. !
B. ?
C. ~
D. $
4.
Like constructors, can there be more than one destructors in a class?
A. Yes
B. No
C. May Be
D. Can’t Say
5.
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