day07

异常

分类

捕获异常

 try{

}catch(Exception e){
    //System.out.println(e.toString());
}finally{
    //关闭IO流
} 

快捷键

Ctrl +Alt +t

抛出异常

  • throw //new

  • throws 方法

自定义

继承Exception

重写ToString()

posted @ 2021-03-14 10:31  曹明磊  阅读(29)  评论(0)    收藏  举报