I've always used == to compare strings until now. I ran into an error, so I decided to change one of the equals signs to .equals() and this solved my problem. Why didn't == work? Are there cases where == should not be used and .equals() should be used instead (obviously aside from fixing the bug.) I'm not sure I really see a difference between the two operators. What's the difference?