到底我哪里定义错了, 自定义异常, 哪里错了?
public class TestException
{
public static void main(String[] args)
{
try
{
int result = new Test().devide( 3, 0 );
//int result = new Test().devide( 3, -1 );
//int result = new Test().devide( 3, 1 );
System.out.println("the result is " + result );
}
catch(DevideByMinusException e)
{
System.out.println("program is running into"+
"DevideByMinusException");
System.out.println(e.getMessage());
System.out.println("the devisor is " +
e. getDevisor());
}
catch(ArithmeticException e)
{
System.out.println("program is running into"+
"DevideByMinusException");
System.out.println(e.getMessage());
}
catch(Exception e)
{
System.out.println("program is running into"+
"other unknowned Exception");
System.out.println(e.getMessage());
}
System.out.println("program is running here ,that is normal !");
}
}