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();
}
}
}
кто может объяснить вывод этого кода?
1. вывод в режиме клиента eclipse (бесконечный):
try try .... ... ... tryfinallyfinally tryfinallyfinally try try try tryfinallyfinally tryfinallyfinally try tryfinallyfinally tryfinallyfinally try .... ....
2. вывод на linux (сбой) в режиме сервера:
try try ... ... try try try try try try MISSING EXCEPTION HANDLER for pc 0x00002aaaab1c53f0 and handler bci -1 Exception: Compiled exception table : ExceptionHandlerTable (size = 3304 bytes) catch_pco = 700 (1 entries) bci -1 at scope depth 0 -> pco 11039 catch_pco = 1736 (1 entries) bci -1 at scope depth 0 -> pco 11473 catch_pco = 1756 (1 entries) bci -1 at scope depth 0 -> pco 11433 catch_pco = 1776 (1 entries)
write(s)
и до вызоваnewLine()
в PrintStream. - person ZhongYu   schedule 01.09.2015