Ask Question
11 April, 16:56

Provide examples of the type of program statement that should be placed in a destructor.

+5
Answers (1)
  1. 11 April, 17:34
    0
    A destructor is called when there is a need to destruct or delete the object that is already created. As a Constructor is used to create an object, similarly a destructor is used to destruct the object. As there will be a default Constructor which is called when creating a new object, the default destructor is called to Destruct the object when the object goes out of scope or the function ends or program ends or a block containing that particular local variable ends or a delete operator is called. Examples for the destructor are (as the destructor contains delete operators)

    Examples : delete []s; In this example when the destructor is called, the delete operator will be called and the object created destructs.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Provide examples of the type of program statement that should be placed in a destructor. ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers