I couldn't figure out the following behaviour,
String str1= "abc";
String str2 = "abc";
System.out.println("str1==str2 "+ str1==str2);
System.out.println("str1==str2 " + (str1==str2))
Output for the above statement is as follows:
false
str1==str2 true
Why is this happening? Why the output is not like follows:
See Question&Answers more detail:osstr1==str2 true
str1==str2 true