Vidyalelo
C++ Programming · Q25

Constructors and Destructors in C++

Programming · C++ Programming · question 25

Q25

What happens if a destructor is made private in a C++ class?

A.
It is a syntax error
B.
The destructor will still be called when needed
C.
It prevents object destruction
D.
The compiler will throw an error
Answer

Answer: Option D

Solution

Answer: Option D
No explanation is given for this question Let's Discuss on Board