An object in a program is not used for long time then it will be automatically deleted by the garbage collector.
It save the some amount of memory.It identifies the objects that are no longer used by a program.
A Java object is subject to garbage collection when it becomes unreachable to the program in which it is used.
System.gc() method may be used to call it explicitly It is controlled by the JVM ,
The JVM runs periodically by using "mark" and "sweep"algorithms.Instead of "destructor"
in c++ , java supports garbage collector.
For read more information :http://www.roseindia.net/java/example/java/io/code-for-garbage-collection.shtml