Skip to content

Commit 512f335

Browse files
Update comments on static variable storage in Java
1 parent 0126e03 commit 512f335

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/java/basis/java-basic-questions-01.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ flowchart TB
636636
public class Test {
637637
// 成员变量,存放在堆中
638638
int a = 10;
639-
// 被 static 修饰的成员变量,JDK 1.7 及之前位于方法区,1.8 后存放于元空间,均不存放于堆中
639+
// 被 static 修饰的成员变量,JDK 1.6 及之前位于永久代,1.7 后移出永久代,一直存放在堆中
640640
// 变量属于类,不属于对象。
641641
static int b = 20;
642642

0 commit comments

Comments
 (0)