String matching and comparing in Java

equals(Object anObject) compare String with object and returns boolean value, for comparing two strings if both are strictly equals(case sensitive) then it will return true else false value.
equalsIgnoreCase(String anotherString) compare two strings with case ignorance and return boolean value.
compareTo(String anotherString) compare two strings and return int value if both are equal(with case) it returns 0.
compareToIgnoreCase(String str) compare two strings and return int value if both are equal(without case) it returns 0.