Reputation: 1
In finalize()
method the statement written after the call to superclass finalize()
method will execute or not?
Upvotes: 0
Views: 59
Reputation: 310893
Not necessarily. An exception might be thrown. But you shouldn't have any code after that anyway. The correct form is:
protected void finalize() throws Throwable
{
try
{
// your code here ...
}
finally
{
super.finalize();
}
}
Upvotes: 1