捕获异常
try{
//要检查的代码
} 
catch(Exception e){
//如果上面出现,处理异常
}
finally{
//怎么都执行的代码块
}

throw new Exception("mes");//抛出自定义异常

首页 我的博客
粤ICP备17103704号