1 String str1="hello";
2 String str2="he"+new String("llo");
3 String str3="he"+"llo";我想问一下,三条语句执行时,分别创建了几个对象。
贴别是第二条,
str1==str2,结果是FALSE,StringBuffer在拼接好的字符串是放在堆中,还是放在字符串常量池中