I thought that strings that are equal would always refer to the same object. The following code seem to suggest that is not the case
class ScjpTest{
public static void main(String[] args){
String a = "Hello";
String b = "World";
String c = a + "World";
String d = "HellowWorld";
String e = a.concat("World");
System.out.println("d==c : " + d==c);
System.out.println("d==e : " + d==e);
}
}
output
false
false