日期:2014-05-20 浏览次数:20723 次
for(int i=0; i<10; i++) { int a = 10; System.out.printf(a+i); }
for(int i=0; i<10; i++) { int e = i; System.out.println(e+i); }/* output: 0 2 4 6 8 10 12 14 16 18
------解决方案--------------------
10次,
0: iconst_0
1: istore_1
2: iload_1
3: bipush 10
5: if_icmpge 26
8: bipush 10 //a
10: istore_2
11: getstatic #2; //Field java/lang/System.out:Ljava/io/PrintStream;
14: iload_2
15: iload_1
16: iadd
17: invokevirtual #3; //Method java/io/PrintStream.println:(I)V
20: iinc 1, 1
23: goto 2
26: return