I have,
String str1 = "StringA";
String str2 = "StringA";
Now, I do
(str1 == str2)
Sometimes it doesn't match the strings and returns false
But str1.equals(str2)
always returns true
What I'm missing here?
I cannot always use equals
as my String
can be null also.
Thanks!