diff options
author | TheDmitry <TheDmitry@users.noreply.github.com> | 2015-01-22 18:23:21 +0300 |
---|---|---|
committer | TheDmitry <TheDmitry@users.noreply.github.com> | 2015-01-22 18:23:21 +0300 |
commit | 16c9262d5afd4fb8ad6c21485bb6d56f7f61215d (patch) | |
tree | 22abebdb5196e8a373b52133517805111334f462 /zh-cn/java-cn.html.markdown | |
parent | acaeb22bf35b5b261d7f5523277564cfb4ae2734 (diff) | |
parent | b4ecc1e760973efb70e842b5186220cf5dba4b51 (diff) |
Merge remote-tracking branch 'upstream/master' into json-ru
Diffstat (limited to 'zh-cn/java-cn.html.markdown')
-rw-r--r-- | zh-cn/java-cn.html.markdown | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/zh-cn/java-cn.html.markdown b/zh-cn/java-cn.html.markdown index f7d319e6..f08d3507 100644 --- a/zh-cn/java-cn.html.markdown +++ b/zh-cn/java-cn.html.markdown @@ -124,7 +124,7 @@ public class LearnJava { // HashMaps /////////////////////////////////////// - // 操作符 + // 操作符 /////////////////////////////////////// System.out.println("\n->Operators"); @@ -161,10 +161,13 @@ public class LearnJava { // 自增 int i = 0; System.out.println("\n->Inc/Dec-rementation"); - System.out.println(i++); //i = 1 后自增 - System.out.println(++i); //i = 2 前自增 - System.out.println(i--); //i = 1 后自减 - System.out.println(--i); //i = 0 前自减 + // ++ 和 -- 操作符使变量加或减1。放在变量前面或者后面的区别是整个表达 + // 式的返回值。操作符在前面时,先加减,后取值。操作符在后面时,先取值 + // 后加减。 + System.out.println(i++); // 后自增 i = 1, 输出0 + System.out.println(++i); // 前自增 i = 2, 输出2 + System.out.println(i--); // 后自减 i = 1, 输出2 + System.out.println(--i); // 前自减 i = 0, 输出0 /////////////////////////////////////// // 控制结构 @@ -192,7 +195,7 @@ public class LearnJava { } System.out.println("fooWhile Value: " + fooWhile); - // Do While循环 + // Do While循环 int fooDoWhile = 0; do { |