I guess this question belongs in the "New To Java" forum, but anyway: the method has been written for you, it's in the String class and is called equals.
String s1 = "joe@ajax.com";
String s2 = "john@acme.com";
if (s1.equals(s2)) System.out.println("they are equal");
For email addresses, you may want to use equalsIgnoreCase() instead.