try catch finally

返回值 2

public static int getNum(){
try{
return 1;

}catch(Exception e){

e.printStackTrace();

}finally{

return 2;
}

}

原文地址:https://www.cnblogs.com/shenjun/p/3059734.html