回答編集履歴
3
追記の追記
test
CHANGED
@@ -7,6 +7,10 @@
|
|
7
7
|
```
|
8
8
|
|
9
9
|
|
10
|
+
|
11
|
+
追記
|
12
|
+
|
13
|
+
---
|
10
14
|
|
11
15
|
swordoneさんの回答と丸被りしてしまったので、ちょっと差別化を図ってみる。
|
12
16
|
|
2
追記
test
CHANGED
@@ -5,3 +5,17 @@
|
|
5
5
|
if(Code.equals("1656")){
|
6
6
|
|
7
7
|
```
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
swordoneさんの回答と丸被りしてしまったので、ちょっと差別化を図ってみる。
|
12
|
+
|
13
|
+
> **15.21.3. Reference Equality Operators == and !=**
|
14
|
+
|
15
|
+
> [中略]
|
16
|
+
|
17
|
+
> While == may be used to compare references of type String, such an equality test determines whether or not the two operands refer to the same String object. **The result is false if the operands are distinct String objects, even if they contain the same sequence of characters (§3.10.5).** The contents of two strings s and t can be tested for equality by the method invocation s.equals(t).
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
引用元:[Java Language Specification - Chapter 15. Expressions](https://docs.oracle.com/javase/specs/jls/se9/html/jls-15.html#jls-15.21.3)、 **太字**は引用者による。
|
1
リンクの追加
test
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
文字列の比較にはString.equalsを用いてください。
|
1
|
+
文字列の比較には[String.equals](https://docs.oracle.com/javase/jp/8/docs/api/java/lang/String.html#equals-java.lang.Object-)を用いてください。
|
2
2
|
|
3
3
|
```Java
|
4
4
|
|