We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 28db32c commit 6de1daeCopy full SHA for 6de1dae
docs/java/jvm/memory-area.md
@@ -363,7 +363,7 @@ String str4 = new StringBuilder().append(str1).append(str2).toString();
363
final String str1 = "str";
364
final String str2 = "ing";
365
// 下面两个表达式其实是等价的
366
-String c = "str" + "str2";// 常量池中的对象
+String c = "str" + "ing";// 常量池中的对象
367
String d = str1 + str2; // 常量池中的对象
368
System.out.println(c == d);// true
369
```
@@ -377,7 +377,7 @@ System.out.println(c == d);// true
377
```java
378
379
final String str2 = getStr();
380
381
String d = str1 + str2; // 在堆上创建的新的对象
382
System.out.println(c == d);// false
383
public static String getStr() {
0 commit comments