这里是一个try、finally语句执行顺序的例子,你看一下,我感觉你就明白了。
public class JVMTest {
public static void main(String[] args){
System.out.println("aa:" + aa());
}
public static int aa(){
int a = 1;
int b = 10;
try{
System.out.println("abc");
return a;
}finally{
a = 2;
System.out.println("a: "+ a);
}
}
}