All mock tests are FREE till 31 December — register to save your progress

Which of the following are TRUE about constructors in C++?
(A) A constructor can be overloaded.
(B) A constructor does not have a return type.
(C) A constructor must be declared as a friend function.
(D) A constructor is called when an object is destroyed.
Choose the correct answer from the options given below:

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: D. (A), (B) Only

Explanation

Constructors can be overloaded and have no return type. They are member functions (not friends), and the destructor, not the constructor, runs when an object is destroyed.

More Programming Languages and Computer Graphics questions