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();
}
}
}
Wer kann die Ausgabe dieses Codes erklären?
1. Ausgabe im Eclipse-Client-Modus (endlos):
try
try
....
...
...
tryfinallyfinally
tryfinallyfinally
try
try
try
tryfinallyfinally
tryfinallyfinally
try
tryfinallyfinally
tryfinallyfinally
try
....
....
2.Ausgabe im Linux-Server-Modus (Crash):
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)