OOPS
August 29, 2024OOPS
August 29, 2024OOPS
Question 198 |
Which of the following is true of constructor function in C++ ?
A class must have at least one constructor. | |
A constructor is a unique function which cannot be overloaded. | |
A constructor function must be invoked with the object name. | |
A constructor function is automatically invoked when an object is created. |
Question 198 Explanation:
FALSE: A class must have at least one constructor.
FALSE: A constructor is a unique function which cannot be overloaded.
FALSE: A constructor function must be invoked with the object name.
TRUE: A constructor function is automatically invoked when an object is created.
FALSE: A constructor is a unique function which cannot be overloaded.
FALSE: A constructor function must be invoked with the object name.
TRUE: A constructor function is automatically invoked when an object is created.
Correct Answer: D
Question 198 Explanation:
FALSE: A class must have at least one constructor.
FALSE: A constructor is a unique function which cannot be overloaded.
FALSE: A constructor function must be invoked with the object name.
TRUE: A constructor function is automatically invoked when an object is created.
FALSE: A constructor is a unique function which cannot be overloaded.
FALSE: A constructor function must be invoked with the object name.
TRUE: A constructor function is automatically invoked when an object is created.