try catch finally return执行顺序:
private static int tryCatchExecute () {
int a = 10;
try {
a /= 0;
} catch (ArithmeticException e) {
e.printStackTrace();
return a; //(1)
} finally {
a = 100;
}
return a;//(2)
}
(1) 位置return,则方法返回,再执行finally;
(2) 位置return,方法执行完finally,再return;