void throwIfTrue(Boolean param) {
try {
if (param)
throw new RuntimeException("test exception");
}
catch (Exception e) {
System.out.println("catch");
}
finally {
System.out.println("finally");
}
}
throwIfTrue(true);
//输出 "catch" 和 "finally"
throwIfTrue(false);
//只输出 "finally"