如何区别代码中横线处的两个 result
main方法:
以下为两个test和test2两个方法:
public int test(){ int divider=10; int result=100; try{ while(result>-1){ divider--; result=result+result/divider; } return result; }catch(Exception e){ e.printStackTrace(); System.out.println("循环抛出异常了!!!"); return -1; } } public int test2(){ int divider=10; int result=100; try{ while(result>-1){ divider--; result=result+result/divider; } return result; }catch(Exception e){ e.printStackTrace(); System.out.println("循环抛出异常了!!!"); return result=999; }finally{ System.out.println("这是finally!!!"); System.out.println("我的值是:"+result); }