From b88cef16b9032c0a8c98fa0cd01a55ac49307337 Mon Sep 17 00:00:00 2001 From: Yif_Corleone Date: Thu, 13 Sep 2018 18:08:37 +0800 Subject: [PATCH] =?UTF-8?q?Java=20=E5=9F=BA=E7=A1=80=20219=E8=A1=8C?= =?UTF-8?q?=E7=AC=94=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 应是 s5 == s6 --- notes/Java 基础.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notes/Java 基础.md b/notes/Java 基础.md index 9da25851..22c94e60 100644 --- a/notes/Java 基础.md +++ b/notes/Java 基础.md @@ -216,7 +216,7 @@ System.out.println(s3 == s4); // true ```java String s5 = "bbb"; String s6 = "bbb"; -System.out.println(s4 == s5); // true +System.out.println(s5 == s6); // true ``` 在 Java 7 之前,String Pool 被放在运行时常量池中,它属于永久代。而在 Java 7,String Pool 被移到堆中。这是因为永久代的空间有限,在大量使用字符串的场景下会导致 OutOfMemoryError 错误。