Java tutorial
public class Main { public static void main(String args[]) { String s1 = "Java2s.com"; String s2 = "java2s.com"; String s3 = "jAva2s.com"; String s4 = "java2s.COM"; System.out.println(s1 + " equals " + s2 + " -> " + s1.equals(s2)); System.out.println(s1 + " equals " + s3 + " -> " + s1.equals(s3)); System.out.println(s1 + " equals " + s4 + " -> " + s1.equals(s4)); } }