An expression-statement evaluates a given expression. The value computed by
the expression, if any, is
discarded.
expression-statement:
statement-expression ;
statement-expression:
invocation-expression
object-creation-expression
assignment
post-increment-expression
post-decrement-expression
pre-increment-expression
pre-decrement-expression
Not all expressions are permitted as statements. [Note: In particular,
expressions such as x + y and
x == 1, that merely compute a value (which will be discarded), are not
permitted as statements. end note]
Execution of an expression statement evaluates the contained expression and
then transfers control to the
end point of the expression statement. The end point of an
expression-statement is reachable if that
expression-statement is reachable.
the expression, if any, is
discarded.
expression-statement:
statement-expression ;
statement-expression:
invocation-expression
object-creation-expression
assignment
post-increment-expression
post-decrement-expression
pre-increment-expression
pre-decrement-expression
Not all expressions are permitted as statements. [Note: In particular,
expressions such as x + y and
x == 1, that merely compute a value (which will be discarded), are not
permitted as statements. end note]
Execution of an expression statement evaluates the contained expression and
then transfers control to the
end point of the expression statement. The end point of an
expression-statement is reachable if that
expression-statement is reachable.
本文详细解析了表达式语句的概念及其使用方式。探讨了包括调用表达式、对象创建表达式在内的多种类型,并强调不是所有表达式都能作为语句使用。
2323

被折叠的 条评论
为什么被折叠?



