+ 1

Is there any difference between finalize() method in java and ~destructor() in c++ ???

25th Nov 2016, 10:07 AM
Ravindra - avatar
2 Answers
+ 5
The main difference between finalize() method and destructor() in c++ is that the destructor() is always called when object goes out of scope but in java finalize() method called by garbage collector sporadically before garbage collector free the objects when no reference to that objects exists.
26th Nov 2016, 4:31 PM
Vishal Koshti
Vishal Koshti - avatar
Differnce between finallize and destructor in java .
30th Jan 2023, 6:31 AM
SYBCA 2021
SYBCA 2021 - avatar