A problem about sef-increment, the codes in the below:
int i=9;
i=i++;
System.out.println(i);
outcome:9
Could you please tell me the reason why the outcome is 9 not 10; thanks
i=i++;
先把i放到一个临时变量,再自增,再把临时变量赋值给i。
http://www.chinaunix.net/jh/26/429688.html
因为临时变量的关系