关于java代码最终的解释:
What happens is that the initial value of x is stored in a temporary register, then x is incremented, then the value stored in the register is asigned to the left hand side of the expression, in this case the LHS is x so x gets its original value.
int x = 1;
x = x++;
Steps:
1 initial value of x is stored in temp register. So temp = 1.
2 x is incremented. x = 2 and temp = 1.
3 the value of the temp register is assigned to the LHS. x = 1 作者: 杨华东 时间: 2012-9-21 19:00