i = i++;
This statement is saying, set i equal to i, and then add 1 to i.
In order for the output in your example to be 1, you would need the following code:
I'm not sure how to articulate the answer in words, but that example should answer your question. Most often I think you see the use of ++ or -- used in counters inside of loops, which are rarely used in conjuction with an assignment statement, so a lot of people aren't aware that it can be used on either side.
--Chris