class Except extends Exception{}
public class Q48
{
public static void main(String[]args)
{
try
{
System.out.println(10/0);
}
catch(Except e)
{
System.out.println("catch block");
}
}
}
Why does this code gives a compiler error,"Except is nit thrown in try block".the statement 10/0 gives an arithmetic exception.Right?
Please help.