I just wanted to create a little Java-Puzzle, but I puzzled myself. One part of the puzzle is:
What does the following piece of code do:
The code
int i = 1; i += ++i + i++ + ++i
is equivalent to
int tmp1 = i // 1, += i ++; // 2 int tmp2 = i; // 2 int tmp3 = i; // 2 i ++; // 3 i ++; // 4 int tmp4 = i; // 4 i = tmp1 + tmp2 + tmp3 + tmp4; // 9