Hi when I am writing the code :
String s1 ="abc";
String s2 ="abc";
System.out.println(s1==s2);
System.out.println(s1.equals(s2));
It's printing
true
true
But when I am writing
String s1 =new String("abc");
String s2 =new String("abc");
System.out.println(s1==s2);
System.out.println(s1.equals(s2));
It's is printing
false
true
Could you please explain the reason behind it?