1. -->
String s1 = "Rishi";
String s2 = "Ri" + "shi";
System.out.println(s1==s2); // true
String s3 = "Ri".concat("shi");
System.out.println(s1==s3); // false
Why while using '+' operator its coming as true but not in case of concatenation?
2. -->
String s1 = "Rishi";
String s2 = "Ri" + "shi";
System.out.println(s1==s2); // true
String s3 = "Ri";
String s4 = s3 + "shi";
System.out.println(s1==s4); // false
Why the output varies even if using the same literal value?