异常

public class Throw11 {
public static void test3(boolean isThrow)throws Exception{
System.out.println("进入test3()。。。");
try{
if(isThrow){
throw new Exception();

}
}
catch(Exception e){
System.out.println("出异常了 我继续抛");
//throw e;
}
System.out.println("正常运行了");
}

public static void main(String[] args) {
try{
//test3(false);
int c = 10/0;
int c1=10/2;
}
catch(Exception e){

System.out.println("出错了");
e.printStackTrace();
}


}

}

posted on 2017-07-12 18:44  Java256  阅读(83)  评论(0)    收藏  举报

导航