What happens (behind the curtains) when this is executed?
int x = 7; x = x++;
That is, when a variable is post incremented and assigned to
x does get incremented. But you are assigning the old value of x back into itself.
x
x = x++;
x++
x =
So in the end, x gets assigned back to its initial value.