Ask Question
28 April, 23:43

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

+3
Answers (1)
  1. 29 April, 03:10
    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?
Get an answer to your question ✅ “Provide examples of the type of program statement that should be placed in a destructor. ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers