1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| Code: stack=2, locals=3, args_size=1 0: bipush 10 // 将10压入栈顶 2: iconst_0 // 将0压入栈顶 3: idiv // 执行除法(10/0),触发ArithmeticException 4: istore_1 // 存储结果(不会执行) 5: getstatic #7 // Field java/lang/System.out:Ljava/io/PrintStream; 8: iload_1 // 加载局部变量1(result) 9: invokevirtual #13 // Method java/io/PrintStream.println:(I)V 12: getstatic #7 // Field java/lang/System.out:Ljava/io/PrintStream; 15: ldc #19 // String finally块始终执行 17: invokevirtual #21 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 20: goto 61 23: astore_1 24: getstatic #7 // Field java/lang/System.out:Ljava/io/PrintStream; 27: aload_1 28: invokevirtual #26 // Method java/lang/ArithmeticException.getMessage:()Ljava/lang/String; 31: invokedynamic #30, 0 // InvokeDynamic #0:makeConcatWithConstants:(Ljava/lang/String;)Ljava/lang/String; 36: invokevirtual #21 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 39: getstatic #7 // Field java/lang/System.out:Ljava/io/PrintStream; 42: ldc #19 // String finally块始终执行 44: invokevirtual #21 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 47: goto 61 50: astore_2 51: getstatic #7 // Field java/lang/System.out:Ljava/io/PrintStream; 54: ldc #19 // String finally块始终执行 56: invokevirtual #21 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 59: aload_2 60: athrow 61: return
|