自定义异常
2019-06-17 本文已影响0人
紫菜_5eac
自定义异常
public class TestException(){
public static void main(String[] args){
try{
int a=0;
throw new AntHdException("001","error");
}catch(AntHdException e){
System.out.println(e.getMessage());
}
}
}
AntHdException中没有super时,打印为null。