Merge pull request #417 from yif-hong/patch-1

Java 基础 219行笔误
This commit is contained in:
郑永川 2018-09-13 19:00:55 +08:00 committed by GitHub
commit 29506244aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 7String Pool 被移到堆中。这是因为永久代的空间有限,在大量使用字符串的场景下会导致 OutOfMemoryError 错误。