求教:
/* String s1 = "a";
String s2 = "b";
String s3 = "c";
String s4 = "abc";
String s5 = s1+s2+s3;
System.out.println(s4 == s5);
System.out.println(s4.equals(s5));
*/
String s1 = "a" + "b" + "c";
String s2 = "abc";
System.out.println(s1 == s2);
System.out.println(s1.equals(s2));
注释部分和下面的部分有什么区别,运行结果不一样的 |