Removing data by using destructors

A destructor is called when an object is destroyed. For example, to deallocate memory that was dynamically allocated for an attribute during construction, add a destructor. Destructors can be protected or private.

Feedback