我有一个类似的程序
class A {
public void test1(String s1) {
try {
System.exit(0);
} catch (Exception ex) {
ex.printStackTrace();
} finally {
System.out.println("from finally");
}
}
public void test2(String s2) {
// some text.....
}
}
在以下级别的中
class Manager {
public static void main(String[] args) {
A a1 = new A();
a1.test1("test1");
a1.test2("test2");
}
}
我想在调用a1.test1
后得到程序流程的详细答案控件将进入Manager类中的a2.test2
或任何其他?请澄清我的疑虑。
一旦点击System.exit(0)
,程序就完成了。它终止了。