public class Foo {
public static void main(String[] args) {
foo();
}
public static void foo() {
try {
System.out.println("try");
foo();
} catch (Throwable e) {
System.out.println("catch");
foo();
} finally {
System.out.println("finally");
foo();
}
}
}
Run Code Online (Sandbox Code Playgroud)
谁能解释一下这段代码的输出?
1.在eclipse(无尽)客户端模式下输出:
try
try
....
...
...
tryfinallyfinally
tryfinallyfinally
try
try
try
tryfinallyfinally
tryfinallyfinally
try
tryfinallyfinally
tryfinallyfinally
try
....
....
2.output on linux(crash)服务器模式:
try
try
...
...
try
try
try
try
try
try
MISSING EXCEPTION HANDLER for pc 0x00002aaaab1c53f0 and handler bci -1
Exception: …