Following the precedence operator in java 8 it is clear that the postfix operator (expr++ expr--) has a higher precedence that the unary operator, pre-unary operator (++expr --expr). However when executing this code:
x = 3; y = ++x - x++;
The value of y is 0
But to me, following the above table, the result should be y = (5 - 3) as x++ should be evaluated first.
Can anyone explain why this is y = 0 and not y = 2?