while comparing to strings we can do using ==
or .equals()
In ==
we know that it checks for references but in .equals()
it checks for contents.
So suppose if there are 2 strings say
String s="SO"; String s1="SO";
so in this case s1==s
and s.equals(s1)
both will give true.
But here it gives me false
So what I assume is +
is high priority than ==
so in this case
System.out.println(""+s1==s);
it will be splitted like (""+s1)==s
and now ""+s1 will be a new String and hence the new String will never be equal to s
so its printing false
I am just interested to know whether I thought is right or not