compareTo( ) method of Date class compares two Dates for ordering and returns a value which may be '0' or less than 0 or maybe greater than 0 also.