代码如下:
public class ResultTest {
public static void main(String[] args) {
int test = test(3,5);
System.out.println(test);
}
public static int test(int x,int y){
int result = x;
try{
if(x < 0 || y < 0){
return 0;
}
result = x + y;
return result;
}finally {
result = x - y;
}
}
}
请问为什么返回的值是8,而不是-2,请大家帮忙回答一下,谢谢了!
