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
When you re-assign the value for x it is still 7. Try x = ++x and you will get 8 else do
x
x = ++x
x++; // don't re-assign, just increment System.out.println(x); // prints 8