Why destructor is used in programming?

In object-oriented programming, a destructor (sometimes abbreviated dtor) is a method which is invoked mechanically just before the memory of the object is released. … Its main purpose is to free the resources (memory allocations, open files or sockets, database connections, resource locks, etc.)

Sizin İçin Seçtik  What is destructor in C++ with example?

Leave a Reply

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