Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fea5d01

Browse filesBrowse files
committed
Merge pull request giantray#3 from Yixiaohan/patch-1
修改官方文档链接失效问题
2 parents 3fc7d8e + e4cda54 commit fea5d01
Copy full SHA for fea5d01

File tree

Expand file treeCollapse file tree

1 file changed

+5
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-5
lines changed

‎contents/java-operator.md

Copy file name to clipboardExpand all lines: contents/java-operator.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ i += j 等同于 i = i + j;
88
int i = 5;
99
long j = 8;
1010
```
11-
这时 i = i + j不能编译,但i += j却可以编译。这说明两者还是有差别的
12-
这是否意味着,i += j,实际是等同于 i= (type of i) (i + j)呢?
11+
这时 i = i + j 不能编译,但 i += j 却可以编译。这说明两者还是有差别的
12+
这是否意味着,i += j实际是等同于 i= (type of i) (i + j)呢?
1313

1414
###回答
15-
这个问题,其实官方文档中已经解答了。 请看这里[§15.26.2 Compound Assignment Operators](http://docs.oracle.com/javase/specs/jls/se5.0/html/expressions.html#15.26.2 )
15+
这个问题,其实官方文档中已经解答了。 请看这里 [§15.26.2 Compound Assignment Operators](http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.26.2)
1616

1717

1818
再照搬下官方文档的说明
1919

2020

21-
对复合赋值表达式来说,E1 op= E2(诸如i += j;i-=j等等),其实是等同于E1 = (T)((E1) op (E2)),其中,T是E1这个元素的类型。
21+
对复合赋值表达式来说,E1 op= E2 (诸如 i += j; i -= j 等等),其实是等同于 E1 = (T)((E1) op (E2))其中,T是E1这个元素的类型。
2222

2323
举例来说,如下的代码
2424
```java
@@ -33,4 +33,4 @@ x = (short)(x + 4.6);
3333

3434

3535
stackoverflow链接
36-
http://stackoverflow.com/questions/8710619/java-operator
36+
http://stackoverflow.com/questions/8710619/java-operator

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.