what is equals() method of comparing strings for if else in java code example Example: how to know if String is the same java String1.equals(String2)