Throwable 异常超类
try、catch、finally、throw、throws
try{
System.out.println(11/0);
}catch (ArithmeticException e){
System.out.println("出现异常!");
}finally {
System.out.println("finally");
}
快捷键 : Ctr l+ Alt + T
继承 Exception 类
public class GendorException extends Exception {
public GendorException(String msg)
{
super(msg);
}
}
原文:https://www.cnblogs.com/gbhh/p/13780977.html