we cannot directly say when the garbage collector will destroy the objects
when a running thread using that object is dead, then only there is a possibility that the objects gets destroyed
and also when the objects are null referenced then they can be destroyed
we can call the gc() method but it is merely a request and not the command
SCJP 6 [86%], OCPWCD [84%], OCEJPAD [83%]
If you find any post useful, click the "plus one" sign on the right
The Object will not get marked for the collection by the GC as long as its reference exists. In case of static it will be loaded till the thread running it is alive. To make it eligible for GC you can call a method which can set the reference to null.