G

Gopal Sharma • 38.32K Points
Coach

Q. Which of the following is true about destructors in C++?

  • (A) A destructor is called when an object is created.
  • (B) A destructor has the same name as the class with a '~' prefix.
  • (C) A destructor can be overloaded.
  • (D) A destructor returns a value.
  • Correct Answer - Option(B)
  • Views: 34
  • Filed under category C++

Explanation by: Gopal Sharma
In C++, a destructor has the same name as the class, preceded by a '~' symbol, and is called when an object is destroyed.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.


Question analytics