suffixedExpression

Figure 6.28. suffixedExpression

suffixedExpression

Table 6.8. Postfix Increment/Decrement Operators

OperatorMeaningOperand TypeResult Type
++Add one to the value of the operand, value is the previous value++ IntegerInteger
++ NumberNumber
--Subtract one from the value of the operand, value is the previous value-- IntegerInteger
-- NumberNumber

This example contrasts these postfix increment/decrement operators with the prefix operators in unaryExpression:

var x = 0;
println( x++ );
println( ++x );
println( x-- );
println( --x );

The following is printed on the console:

0 
2 
2 
0