postfix increment expression

Xiao20111130 2011-12-27 03:36:45

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 variable, but a value.
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.

求人帮忙解释一下
后缀表达式结果必须是一个数值类型变量,否则编译错误
后缀++表达式必须是变量类型
它的结果是数值而非变量

英语比较烂 实在没看懂
是不是说i++是个变量 却又说i++的结果是数值????

...全文
30 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
西部流云 2011-12-27
  • 打赏
  • 举报
回复
上面意思大概说:
后缀表达式的结果要么是一个整型,或者编译时的错误。
后缀表达式的类型跟变量的类型一样
后缀表达式的结果不是一个变量,而是一个值
被声明为final的变量不能进行incremented,因为....

不知道理解对不对,请楼下继续分析。

62,615

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧