Rajeev Rnair wrote:No, there is no guarantee with GC even if you call System.gc() explicitly. finalize() may be called and it may NOT be called! That is why it is not advisable to put clean up code in finalize() method!
Yes, " there is no guarantee with GC even if you call System.gc()"
You are right, however I was asking also for the end of main.