Does Java have destructors?
Java does not have destructors; but it has finalizers that does a similar job.
Garbage collector does the job working in the background
Here is the syntax
public void finalize(){
}
if an object has a finalizer, the method is invoked before the system garbage collects the object
Recent Comments