what is "++" mean for java?

2008-02-21 10:30 am
what is "++" mean for java?

回答 (2)

2008-02-21 2:01 pm
✔ 最佳答案
++ 是一個 increment operator,將其operand的值增加1。

e.g.
int i = 5;
i++;
//結果: i = 6

i = 5
int x = i++;
// 結果: x = 5, i = 6

i = 5;
x = ++i;
// 結果: x = 6, i = 6

++在operand前或後決定程式執行的次序。
2008-02-21 10:36 am
++ Increment operator; increments a value by 1


收錄日期: 2021-04-25 20:32:41
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20080221000051KK00263

檢視 Wayback Machine 備份