what happens if destructor is not present? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

what happens if destructor is not present?

23rd Jun 2016, 7:12 PM
rohith chittamuru
rohith chittamuru - avatar
7 Answers
+ 1
nothing will happen :) destructors are optional :) they are not required to be present in your code.
24th Jun 2016, 1:02 PM
Erwin Mesias
Erwin Mesias - avatar
0
not thing
24th Jun 2016, 12:34 AM
Farshid Rezaei
Farshid Rezaei - avatar
0
destructors are optional... you can use them or not use them.... just in case: they are used to do stuff before deleting an object... like writing by console "destruction >:D!!"
29th Jun 2016, 2:46 AM
tumor12
0
destructor are not necessarily added.... a program can run successfully without using a destructor.
2nd Jul 2016, 10:39 AM
Nikita Singh
Nikita Singh - avatar
0
Our world will be safe
15th Jul 2016, 7:43 AM
Genti Perja
0
memory is not freed
5th Feb 2017, 6:41 PM
Rohit Thakur
- 11
the compiler will not let you create a class
23rd Jun 2016, 9:42 PM
Anton Furman
Anton Furman - avatar