812 B
812 B
parents | |
---|---|
|
public class Train {
public static void main(String[] args) {
test();
System.out.println("finish");
}
private static void test() {
try {
method();
} catch (RuntimeException runtimeException) {
System.out.println("catch runtime");
throw new Exception("mega surprise");
} catch (Exception exception) {
System.out.println("catch exception");
} finally {
System.out.println("finally");
}
System.out.println("message");
}
private static void method() {
throw new RuntimeException("surprise");
}
}
%% catch runtime finally mega surprise в стектрейсе %%