Compare commits

..

1 Commits

Author SHA1 Message Date
893394a6af Merge 150c8713ae into ad9aaf759e 2025-01-01 22:03:58 +08:00

View File

@ -242,12 +242,10 @@ sb.append("!");
### 比较 ### 比较
```java ```java
String s1 = "QuickRef"; String s1 = new String("QuickRef");
String s2 = new String("QuickRef"); String s2 = new String("QuickRef");
s1 == s2 // false s1 == s2 // false
s1.equals(s2) // true s1.equals(s2) // true
// intern 方法获得字符串常量池中的惟一引用
s1 == s2.intern() // true
"AB".equalsIgnoreCase("ab") // true "AB".equalsIgnoreCase("ab") // true
``` ```
@ -312,7 +310,7 @@ int[] a3 = new int[]{1, 2, 3};
int[] a4 = new int[3]; int[] a4 = new int[3];
a4[0] = 1; a4[0] = 1;
a4[2] = 2; a4[2] = 2;
a4[3] = 3; // 会出现索引越界异常 a4[3] = 3;
``` ```
### 修改 Modify ### 修改 Modify