File tree Expand file tree Collapse file tree 2 files changed +2
-4
lines changed
Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Original file line number Diff line number Diff line change 1111| 定义位置 | 在类中,方法外 | 方法中或者方法的形参 | 在类中,方法外 |
1212| 初始化值 | 有默认初始化值 | 无,先定义,复制后才能使用 | 有默认初始化值 |
1313| 调用方法 | 对象调用 | | 对象调用,类名调用 |
14- | 存储位置 | 堆中 | 栈中 | 方法区 |
14+ | 存储位置 | 堆中 | 栈中 | 方法区(jdk6) |
1515| 生命周期 | 与对象共存亡 | 与方法共存亡 | 与类共存亡 |
1616| 别名 | 实例变量 | | 类变量,静态成员变量 |
1717
@@ -2987,7 +2987,7 @@ public static void main(String[] args) {
29872987
29882988##### 内存位置
29892989
2990- Java 7之前,String Pool 被放在运行时常量池中,它属于永久代; Java 7以后,String Pool 被移到堆中,这是因为永久代的空间有限,在大量使用字符串的场景下会导致OutOfMemoryError 错误
2990+ Java 7之前,String Pool 被放在运行时常量池中,属于永久代;** Java 7以后,String Pool 被移到堆中** ,这是因为永久代的空间有限,在大量使用字符串的场景下会导致OutOfMemoryError 错误
29912991
29922992演示 StringTable 位置:
29932993
Original file line number Diff line number Diff line change 11作者的个人学习笔记,每次学有所获都会更新笔记,所有的知识都有借鉴其他前辈的博客和文章,排版布局美观整洁,希望对各位朋友有所帮助。
22
3- 作者正在找Java开发实习生的工作,如果有可以帮忙内推的前辈,可以发我邮件:zhyzhyang@sina.com
4-
53注:所有的知识不保证权威性,如果各位朋友发现错误,非常欢迎与我讨论。
64
You can’t perform that action at this time.
0 commit comments