考虑下面的代码,如果catch子句中抛出异常,最终是否仍会运行?
try {
//code here throws exception
}
catch(Exception ex) {
//code catches above exception however code here also throws another exception
}
finally {
//does this code even run considering the exception thrown in the above catch clause??
}
答案 0 :(得分:7)
是的。它运行时无论try / catch中发生了什么(假设JVM由于某种原因没有关闭)