????int i = 0;
????i = i++;
???????????0
?????????
???????????????????????????++????棬?????????i??“???”???????i++????????????0????????????????????????????????????????????????????++?????????????????????????0
????????????????????
????int i = 0;//?????????
????i = i++;//??Ч??????????
????int temp = i;//???temp??i++??????????
????i++; //i????
????i = temp;//?????????????????i
????????java????????????????????????c????c++?п??????????????????????????и????????????????????
???????????:??????????????ж???????????????????
?????????????????ο????????????£?
????public class Test {
????public static void main(String... args) {
????int i = 0;
????i = i++;
????System.out.println(i);
????}
????}
???????javac??????????javap -c Test????????????????????????£????main????????
????public static void main(java.lang.String[]);
????Code:
????0: iconst_0
????1: istore_1
????2: iload_1
????3: iinc 1?? 1
????6: istore_1
????7: getstatic #2; //Field java/lang/System.out:Ljava/io/PrintStream;
????10: iload_1
????11: invokevirtual #3; //Method java/io/PrintStream.println:(I)V
????14: return
????????????0?п?????????????С????????????????????????????????
????0????????0??????????????0??
????1????????????????????0?????浽???????????????1????????i??????????????????
????2??????????????????1????????i???????????????????0??
????3??????????????????1????????i???????????????????????????1????????i???????1??????????0??
????6??????????????????浽??????????????1?????i???????????i??????0????????????
????7??????????????????2?????????????????System.out???????????
????10??????????????????1????????i???????????????0??
????11?????ó??????????3??????????System.out.println
????14??????main????