System.out.println(s3 == s1 + s2);// false
变量拼接,先开辟空间,地址值当然不一样
System.out.println(s3.equals((s1 + s2)));// trueSystem.out.println(s3 == "hello" + "world");// false 这个我错了,应该是true
两个常量拼接,先拼接,然后找有没有,s3有
System.out.println(s3.equals("hello" + "world"));// true原文地址:http://blog.csdn.net/chaoshenyutou/article/details/45040079