+ 2
Distructors
is there a distracture in java and how can we use him ?
1 Answer
+ 2
Because Java is a garbage collected language you cannot predict when (or even if) an object will be destroyed. Hence there is no direct equivalent of a destructor. There is an inherited method called finalize, but this is called entirely at the discretion of the garbage collector.