1 String s1 = "aa"; 2 String s2 = "aabb"; 3 String s3 = "aa"+"bb"; 4 5 String s4 = new String("aabb"); 6 String s5 = new String("aabb"); 7 8 String s6 = s1 + "bb"; 9 String s7 = s1 + s2; 10 sop(s2==s3);//true 11 sop(s2==s4);//false 12 sop(s4==s5);//false 13 sop(s6==s2);//false 14 sop(s7==s6);//flase
原文:http://www.cnblogs.com/linson0116/p/3548959.html