A class in C++ can have the following
2026
A class in C++ can have the following
Answer: C. Multiple CONSTRUCTORS and one DESTRUCTOR — In C++, a class can have multiple constructors via constructor overloading, but only one destructor. A complete solution is required to explain these class…
- A.
One CONSTRUCTOR and one DESTRUCTOR
- B.
One CONSTRUCTOR and multiple DESTRUCTORS
- C.
Multiple CONSTRUCTORS and one DESTRUCTOR
- D.
Multiple CONSTRUCTORS and multiple DESTRUCTORS
Attempted by 191 students.
Show answer & explanation
Correct answer: C
In C++, a class can have multiple constructors via constructor overloading, but only one destructor. A complete solution is required to explain these class members.
Loading lesson…