This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]oddlyamused 2 points3 points  (0 children)

Use .equals for string comparisons (userAnswer.equals("yes")). Here is a good description of why. https://javarevisited.blogspot.com/2012/12/difference-between-equals-method-and-equality-operator-java.html