Consider the following :
String s1 = "hello";
String s2 = "lo";
System.out.println(s1 == ("hel"+"lo")); // true
System.out.println(s1 == ("hel"+s2)); // false
When + operator is used, internally a string buffer is used and a new string is returned. So why is this strange behavior...i mean since s2=="lo" both should be true. Or if a new string is being returned both should be false.why are they different?