其他分享
首页 > 其他分享> > a[i++]=1 优先级

a[i++]=1 优先级

作者:互联网

public class t {

	public static void main(String[] args) {
	
		        int[] a= {0};
		        int i=0;
		       a[i++]=1;
		    }
}

a[i++]=1;
优先级 先自加再赋值

javap反编译

Compiled from "a3.java"
public class r.a3 {
  public r.a3();
    Code:
       0: aload_0
       1: invokespecial #8                  // Method java/lang/Object."<init>":()V
       4: return

  public static void main(java.lang.String[]);
    Code:
       0: iconst_1
       1: newarray       int
       3: astore_1						
       4: iconst_0			
       5: istore_2				//存变量2上  i
       6: aload_1				//加载数组
       7: iload_2				//加载变量2数值   
       8: iinc          2, 1	//i自加
      11: iconst_1				//存1
      12: iastore				//保存
      13: return
}

标签:优先级,++,int,a3,iconst,java,public
来源: https://blog.csdn.net/Harry_CHL/article/details/120254556