You're incorrectly using the comparison operators instead of using the equals method. See: Common Java Mistakes: == operator or equals() method (note that this is valid for both the != and ==...