美文网首页
自定义异常

自定义异常

作者: 紫菜_5eac | 来源:发表于2019-06-17 16:37 被阅读0次
自定义异常

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。

相关文章

网友评论

      本文标题:自定义异常

      本文链接:https://www.haomeiwen.com/subject/oqqzfctx.html