UEIOE - Use 'equals' Instead Of '=='
The '== ' operator used on strings checks if two string objects are identical. However, in most cases, one would like to check if two strings that have the same value. In these cases, the 'equals' method should be used.
Wrong
if (str1 == str2) {
// do something
}
}
Tip: Replace '==' operator with 'equals' method.
Right
if ( str1.equals(str2) ) {
// do something
}
}