What is the purpose of using a destructor? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

What is the purpose of using a destructor?

23rd Mar 2017, 4:18 AM
Muhammad Hamza
Muhammad Hamza - avatar
4 Answers
+ 9
to destroy your enemies!
23rd Mar 2017, 4:27 AM
Ahri Fox
Ahri Fox - avatar
+ 2
Whenever scope ends or objects gets deleted specificly! We can implement any certain code we want to run in the end (when objects deletes). Also it helps in free up space!!!
23rd Mar 2017, 5:54 AM
Harjeet Singh
Harjeet Singh - avatar
+ 1
To destroy unused object and free up memory.
23rd Mar 2017, 4:34 AM
Nəzər Nəsirzadə
Nəzər Nəsirzadə - avatar
+ 1
to destroy the object memory at time use destructor
23rd Mar 2017, 10:21 AM
Bhumiben Solanki