What do you know about the garbate collector ?
Garbage collector removes the unreferenced objects from heap memory. By nulling the reference By assigning a reference to another By annonymous object etc. The finalize() method is invoked each time before the object is garbage collected. This method can be used to perform cleanup processing. This method is defined in Object class as: protected void finalize() The gc() method is used to invoke the garbage collector to perform cleanup processing. The gc() is found in System and Runtime classes. public static void gc()