πŸ“Š C++
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.
πŸ’¬ Discuss
βœ… Correct Answer: (B) A destructor has the same name as the class with a '~' prefix.

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

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.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
112
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Gopal Sharma
Publisher
πŸ“ˆ
88%
Success Rate