Q. What are destuctors?

Love and Share

Answers : A destructor is a special method which is used to destroy the objects that have been created by a constructors.

In general, A destructor is a special member function that is called when the lifetime of an object ends. The purpose of the destructor is to free the resources that the object may have acquired during its lifetime..

Some of the important action that a destructor makes is :

– they close the file / database connection.

– it does many kinds of housekeeping tasks

– Release network resources  etc.

 

Love and Share

Leave a Reply

Your email address will not be published. Required fields are marked *