Garbage collection is nothing but cleaning up the unreachable instance or objects like File Handlers..etc. We can explicitly call System.gc() or Runtime.gc() method to cleanup the unreachable objects. Actually we dont want to use any of the garbage collection methods , In 1.4.1 version we have 3 different Garbage Collection algorithm, that will automatically run cleanup the garbage. Otherwise we can use finalize() method for calling these gc() methods.
Take a look at this link for more info..
http://java.sun.com/developer/technical ... LT/RefObj/