This repository has been archived by the owner on Mar 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
JVM Notes 1
spencercjh edited this page Jan 8, 2020
·
2 revisions
这图是JDK 8之前的结构
对比一下:
这图是JDK 8之后的结构
看书还没看明白要写点代码才能彻底搞懂:
还搁这 JDK 6 VS JDK 7呢,我给你看个JDK 13:
public class Test{
public static void main(String[] args) {
final String str1 = new StringBuilder("计算机").append("软件").toString();
// true
System.out.println(str1.intern() == str1);
System.out.println(Tests.class.getName());
final String str2 = new StringBuilder("com.").append("test.").append("Tests").toString();
// false
System.out.println(str2.intern() == str2);
final String str3 = Tests.class.getName();
// false
System.out.println(str2 == str3);
// true
System.out.println(str2.intern() == str3);
System.out.println("end");
}
}
写代码,优雅二字当头。
Elegance is the most important during coding.