How to check if two strings are equal in Java?
Answers
Answered by
0
The == operator checks to see if the two strings are exactly the same object. The .equals() method will check if the two strings have the same value. Strings in Java are immutable. That means whenever you try to change/modify the string you get a new instance.
Similar questions