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
Post Increment operator works as follows:
So the statement
int x = 7;
x = x++;
would be evaluated as follows:
So x is indeed increased but since x++ is assigning result back to x so value of x is overridden to its previous value.