My friend sent me a joke:
Q. What\'s the difference between C and C++?
A. Nothing, because: (C - C++ == 0)
I tried to change
Whether it outputs 0 or -1 for the first println and 0 or 1 for the second is undefined. The compiler is at liberty to evaluate the left or right hand side first and so whether the increments have taken effect by the time the right hand side is evaluated will depend on the compiler (and indeed the compiler could do one thing one time and another the next)
The increments are only guaranteed to take place at the next sequence point. Subtraction is not a sequence point.
EDIT: Bah, wrote that answer when the question was tagged C/C++. Sequence points don't apply to Java. I've left the answer in case others find it useful when considering C/C++ expressions