In Java Strings, the ==
operator is used to check a match of the reference of both the string instances whereas equals()
method used to check if the content of the strings match.
if (segments[0].equals("draw")) println("I found draw");
else println("I did not find draw");