JAVA strings compare reference for myself:

However, to be safe, most of the time, programmers should use “.equals” rather than “==” to avoid unexpected outcome. It simply because “.equals” will compare 2 strings character by character to determine equality while “==” checks whether 2 string objects are identical. Try to do this experiment and you will understand: