This happens because of operator precedence. PPOMASRELSTA - pg 52
1. i is a primitive assigned the value of 0
2. i is incremented with post unary operator i++. This FIRST returns i and then increments it. So what has been returned is 0 and THEN i is set to 1
3. the LOWER precedence assignment operator = is applied and sets i to the value returned. That value is 0
so i, in the middle of the operation, is set to 1 and then immediately set back to 0.