我想知道 java try-catch 语句的执行路径,找不到关于以下情况的详细信息。
如果我有这样的声明:
try {
// Make a call that will throw an exception
thisWillFail();
// Other calls below:
willThisExecute();
} catch (Exception exception) {
// Catch the exception
}
thisWillFail() 下面的行会在移动到 catch 之前执行,还是会在抛出异常后立即执行 try 语句?
换句话说,假设 call 'a' 之后的 call 'b' 将执行是否安全,前提是 call 'a' 不会在 try 语句中引发异常?
谢谢