For starters, use the .equals method to compare the equality of Strings and any other objects.
See what happens and I will look closely the rest of code later.
String s1 = "a";
String s2 = "b";
// examples
boolean b = s1.equals(s2);
b = s1.equals("ccc");
b = "abc".equals(s2);
javaAddict
Nearly a Senior Poster
3,329 posts since Dec 2007
Reputation Points: 1,014
Solved Threads: 448