In the follwing class the "protected void finalize()" method gets compiled
<code>
public class FinalException {
FinalException() {
System.out.println("Creating FinalException ");
}
protected void finalize() {
System.out.println("finalizing ");
//super.finalize();
}
public static void main(
String[] args)
{
new FinalException();
System.gc();
}
}
</code>
But when I call the "superclass finalize()"(which is commented in the above code method I get the error that the Throwable exception must be caught. Why the Exception has to be caught only when the superclass finalize() is called.