finally 块内使用的 return、throw、break、continue 和 yield 语句。
这些会导致 finally 块无法正常完成,而是突然完成。
从同一 try-catch 语句的 try 和 catch 块抛出的任何异常将被禁止。
示例:
void x() {
try {
throw new RuntimeException();
} finally {
// 如果 bar() 返回 true,则 RuntimeException 将被禁止
if (bar()) return;
}
}