+ 2
Destructors in Java
Hello!! Is there a way to create destuctors in classes?? If i can't why Java doesn't support it like C++? Thanks
2 Answers
+ 7
Destructor is a special method where the "clean-up" routine is performed, the place where used resources be released, in order that other programs can use/reuse them.
As I understand it, Java relies on the garbage collector to do this, and as such, no need to create a destructor because the "clean-up" chores had been taken care of by the garbage collector.
Hth, cmiiw
0
please guide me in java