How do I compare strings in Java?
sam
378
Points
48
Posts
|
Hi, How do I compare strings in Java? |
Answers
Brian
2376
Points
13
Posts
|
Hi Sam, use .equals() method: string1.equals(string2)
It returns true if string1 is equals to string2 in value. Else, it will return false.
Posted On:
31-Jul-2015 00:18
|