String objects belong to real class String and should be compared using equals and not using ==. == will compare the references only.

Java Code:
String s1 = "Java String 1";
String s2 = "Java String 2";

if(s1.equals(s2))
   System.out.println("Strings are equal.");
else
   System.out.println("Strings are not equal.");