本文主要是介绍finally 语句块的深度辨析,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
/** * Created by HASEE on 2017/4/24. */ public class FinallyDemo2 {public static void main(String[] args) {System.out.println(test());}private static int test() {int i=10;try {System.out.println("执行try:1");//return i+=20; i=i/0;}catch (Exception e){i+=15;System.out.println("执行catch:2");}finally {System.out.println("执行finally:3");if (i>15){System.out.println("i>15:4");}i+=50;}return i;}}
这篇关于finally 语句块的深度辨析的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!