No garbage collector does the job working in the background.
Hi... There is no concept of "destructors" in java.Java supports this specility by introducing the "GarbageCollector".The Garbagecollector is under the control of the JVM.JVM runs the Garbagecollector periodically basing on "mark and sweep" algorithms.U can force the garbagecollector by using the System.gc() and Runtime.gc()methods.The purpose of garbage collector to reclaims the memory of objects those are no longer used in the programming segment.
No, java does not support destructors. All freeing the memory task is done by GARBAGE COLLECTOR. But you can do such freeing memory by assigning NULL to it, ob=NULL; And then the Garbage Collector frees it because that object have no references to it.