Area: HotSpot Synopsis: In JDK 7, interned strings are no longer allocated in the permanent generation of the Java heap, but are instead allocated in the main part of the Java heap (known as the young and old generations), along with the other objects created by the application. This change will result in more data residing in the main Java heap, and less data in the permanent generation, and thus may require heap sizes to be adjusted. Most applications will see only relatively small differences in heap usage due to this change, but larger applications that load many classes or make heavy use of the String.intern() method will see more significant differences. RFE: 6962931
String a = "holten"; String b = "holten";
String a = new String("holtenObj");
String b = new String("holtenObj");
/**
* Created by holten.gao on 2016/8/16.
*/
public class Main {
public static void main(String[] args){
String str1 = "高小天";
String str2 = "高小天";
System.out.println(str1==str2);//true
String str3 = new String("高大天");
String str4 = new String("高大天");
System.out.println(str3==str4);//false
}
}
true false
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有