1)--
In the whizlab simulator: There is question on the garabage collection , says that : any exception occured in the finilize() method .. the garabage collection WILL RUN AND IGNORE IT...I can NOT Understand That..
the garbage collection runs in its own deamon
thread, any exception thrown in it cannot propegate through any other threads (e.g. your code). The exception thrown in the finalize() method will be caught straight away and will not blow up the gc (preventing it from continuing to gc other objects) or print stack dumps etc.
2)----
If the object is GCed,is the finilze method guaranteed to run..
yes, part of GCing an object is running its finalize method.
3)-- How we can re-allocate the objetc in finilaze() method ,so that we prevent the object from GCed....
give some other object (that is not currently eligible for GC a reference to the object). For example add it to a collection: