Thursday, March 29, 2007

Exception in finalize() method

All,
Tell me what would happen if an exception is thrown in a finalize() method. Would the object be garbage collected or not?

Post your reply

3 comments:

Kalidass Mookkaiah said...

Normal flow will be there for the program

Veerappan said...

What do you mean by that? I asked if the object would be garbage collected or not?

Kalidass Mookkaiah said...

If an exception is thrown in a finalize() method, the object would be garbage collected.

But gc happens provided that there are no other possible active reference from an live thread.