Based on the Oracle: Operator Doc Oracle
The preference of postfix incr and decr operator is higher than prefix operators.
But when I try this example:
int x = 1;
System.out.println(++x * x++); // prints 4
x=1;
System.out.println(x++ * ++x); // prints 3
If we go as the operators precedence, the output should be : 3 and 3
instead of 4 and 3
.
Any help is appreciated.