How the String creation is working here? How s1 & s2 references to same object in String pool but the same is not working with s1 & s4
String s1 = "tomcat10";
String s2 = "tomcat" + 10;
String s3 = "tomcat";
String s4 = s3 + 10;
System.out.println(s1==s2);//true
System.out.println(s1==s4);//false