0
当我执行该代码我得到了“终于”它是否像reThrowing相同的异常?
public class Tester {
static void method() throws Exception {
throw new Exception();
}
public static void main(String... args) {
try {
method();
} catch (Throwable th) {
try {
new Exception();
} catch (Exception e) {
System.out.print("Exception");
} finally {
System.out.print("finally");
}
}
}
}
无法找出执行的流程!
你在上面的代码中有什么困惑? –
我没有混淆,而是我跳过'新的异常();'认为这个异常实际上是抛出。 @RamanSahasi –
没有问题,混乱是编程的一部分。 :) –