You can embed expressions involving the increment operator, ++
, or
the decrement operator, --
, in larger expressions, such as the
following:
++x + x
In such an expression, the increment operator, ++
, is said not only
to produce a value, but also to have the side effect of incrementing
x
.
Note that the Java language prescribes that operands are evaluated in
left-to-right order.
Thus, in the expression ++x + x
, the left-side operand, ++x
,
is evaluated before the right-side operand, x
.