EXPRESSIONS
Postfix Decrement Operator
15.13.3
Otherwise, it is a qualified name of the form
Ename
.
Identifier
, where
Ename
is itself an
ExpressionName
, and the
ExpressionName
is treated exactly as if it
had been the field access expression ( 15.10):
(
Ename
).
Identifier
containing a parenthesized expression ( 15.7.3).
15.13.2 Postfix Increment Operator
++
PostIncrementExpression:
PostfixExpression
++
A postfix expression followed by a
++
operator is a postfix increment expres
sion. The result of the postfix expression must be a variable of a numeric type, or a
compile time error occurs. The type of the postfix increment expression is the
type of the variable. The result of the postfix increment expression is not a vari
able, but a value.
At run time, if evaluation of the operand expression completes abruptly, then
the postfix increment expression completes abruptly for the same reason and no
incrementation occurs. Otherwise, the value
1
is added to the value of the variable
and the sum is stored back into the variable. Before the addition, binary numeric
promotion ( 5.6.2) is performed on the value
1
and the value of the variable. If
necessary, the sum is narrowed by a narrowing primitive conversion ( 5.1.3) to
the type of the variable before it is stored. The value of the postfix increment
expression is the value of the variable
before
the new value is stored.
A variable that is declared
final
cannot be incremented, because when an
access of a
final
variable is used as an expression, the result is a value, not a
variable. Thus, it cannot be used as the operand of a postfix increment operator.
15.13.3 Postfix Decrement Operator
PostDecrementExpression:
PostfixExpression
A postfix expression followed by a
operator is a postfix decrement expres
sion. The result of the postfix expression must be a variable of a numeric type, or a
compile time error occurs. The type of the postfix decrement expression is the
type of the variable. The result of the postfix decrement expression is not a vari
able, but a value.
At run time, if evaluation of the operand expression completes abruptly, then
the postfix decrement expression completes abruptly for the same reason and no
decrementation occurs. Otherwise, the value
1
is subtracted from the value of the
345
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Inexpensive Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Jsp Hosting
Cheap Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved