各位大神,小弟菜鸟一枚,在用eclipse断点查看下面代码执行时发现,在调用getInt()方法后,程序并没有结束,而是进入了Thread的exit()方法中,这是怎么回事?
public class Test {
public static void main(String[] args) {
System.out.println(getInt());
}
public static int getInt() {
int a = 100;
try {
System.out.println(a / 2);
a = 200;
return a;
} catch (ArithmeticException e) {
a = 300;
} finally {
a = 400;
System.out.println("finally已经执行了");
}
return -1;
}
} |
|