mirror of
https://github.com/LingCoder/OnJava8.git
synced 2026-08-24 06:53:27 +08:00
Update 04-Operators.md
This commit is contained in:
@@ -49,7 +49,7 @@ public class Precedence {
|
||||
|
||||
这些语句看起来大致相同,但从输出中我们可以看出它们具有非常不同的含义,具体取决于括号的使用。
|
||||
|
||||
我们注意到,在 `System.out.println() ` 语句中使用了`+`运算符。 但是在这里 `+`代表的意思是字符串连接符。当编译器看到字符串的后面连着一个非`+`连接的非字符串,那么其将会试图去转换这个非字符串成为字符串。上例中的输出结果说明了 a 和 b 都已经被转化成了字符串。
|
||||
我们注意到,在 `System.out.println()` 语句中使用了`+`运算符。 但是在这里 `+`代表的意思是字符串连接符。编译器会将`+`连接的非字符串尝试转换为字符串。上例中的输出结果说明了 a 和 b 都已经被转化成了字符串。
|
||||
|
||||
|
||||
<!-- Assignment -->
|
||||
@@ -113,4 +113,4 @@ public class Precedence {
|
||||
|
||||
|
||||
<!-- 分页 -->
|
||||
<div style="page-break-after: always;"></div>
|
||||
<div style="page-break-after: always;"></div>
|
||||
|
||||
Reference in New Issue
Block a user