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?
B. Virtual Function
Destructor has the same name as the constructor and it is preceded by?
Like constructors, can there be more than one destructors in a class?
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.