how to check 2 strings are equal in java code example Example: how to know if String is the same java String1.equals(String2)