Why is the result false?
String s1 = "hello";
String s2 = "world";
String s3 = "helloworld";
String s4 = s1+s2;
System.out.println(s3==s4);
As I know, there's already one "helloworld" in the constant pool.
Thanks for answering, but what I want to ask is not the difference between "==" and "equals", I just want to make sure s1+s2;
makes a new String, even though there's already one String Object with value "helloworld" in memory.