A

Admin • 833K 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: 19
  • Filed under category C++
  • Hashtags:

Explanation by: Admin

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.