本帖最后由 liuch111 于 2015-8-17 21:15 编辑
下面代码能看明白 你基本上就懂了
- public class FinallyTest1 {
- public static void main(String[] args) {
-
- System.out.println(test11());
- }
-
- public static String test11() {
- try {
- System.out.println("try block");
- return test12();
- } finally {
- System.out.println("finally block");
- }
- }
- public static String test12() {
- System.out.println("return statement");
- return "after return";
- }
-
- }
复制代码
|