1
0
mirror of https://github.com/Snailclimb/JavaGuide synced 2025-06-16 18:10:13 +08:00

Update memory-area.md

This commit is contained in:
guide 2021-12-16 21:54:08 +08:00
parent 08f263d923
commit e9f23e6d08

View File

@ -318,7 +318,7 @@ System.out.println(str4 == str5);//false
> ```java > ```java
> String aa = "ab"; // 放在常量池中 > String aa = "ab"; // 放在常量池中
> String bb = "ab"; // 从常量池中查找 > String bb = "ab"; // 从常量池中查找
> System.out.println("aa==bb");// true > System.out.println(aa==bb);// true
> ``` > ```
> >
> JDK1.7 之前运行时常量池逻辑包含字符串常量池存放在方法区。JDK1.7 的时候,字符串常量池被从方法区拿到了堆中。 > JDK1.7 之前运行时常量池逻辑包含字符串常量池存放在方法区。JDK1.7 的时候,字符串常量池被从方法区拿到了堆中。