hello
I wanted to know, if we are calling a finalize() method ,why we have to catch the Throwable exception or we have to mention that it throws this exception
i.e
public static void main(
String s[]) throws Throwable
{
new Object().finalize();
}
why we have to include a throws clause or we have to catch this exception.
Is Throwable/Exception is consider as a Checked Exceptions ?
public void fun()
{
// code not throwing any IOExceptions
}
catch(IOException e)
{}
this code will cause an compile time error. as IOException is checked exception.
public void fun()
{
//code not throwing any kind of exception
}
catch(Exception e)
{}
This is compile and run perfectly
Is there is some rule which i am missing