标签:ati runtime == stat turn row run new else
private static int test1(int x) {
try{
if(x == 1){
throw new RuntimeException();
}else{
return x;
}
}catch(Exception e){
return x;
}finally{
x = x + 1;
}
}
返回值为x,x=x+1会被运算,但是先保存返回值,再运算
-------------------------------
try{
if(x = 1){
return throw new RuntimeException();
}else{
return 1;
}
}catch(Exception e){
return 2;
}finally{
return 3;
}
永远返回3
标签:ati runtime == stat turn row run new else
原文地址:https://www.cnblogs.com/yuanfei1110111/p/10134460.html