(二十三)控制转移指令

一、概念

 

 二、案例

  • 源代码

public class Test {

    public static void main(String []args){
        
        int age = 10;
        
        if( age > 10 ){
            System.out.println("  > 10");
        }else{
            System.out.println(" < = 10");
        }
        
        String userName = "admin";
    }
}
  • javap -verbose Test.class 解析如下,当程序运行到if语句时,执行if_icmple指令,判断(age>10)是否成立,如果成立则继续执行,如果不成立则跳转到20行继续执行,即跳转到getstatic指令。

 

 

posted @ 2018-06-09 20:38  shyroke、  阅读(205)  评论(0编辑  收藏  举报
作者:shyroke 博客地址:http://www.cnblogs.com/shyroke/ 转载注明来源~