public int compareTo(Date anotherDate)Compares two Dates for ordering.
anotherDate - the Date to be compared.
the value 0 if the argument Date is equal to this Date; a value less than 0 if this Date is before the Date argument; and a value greater than 0 if this Date is after the Date argument.
for an Example:
If you do that, then "26-11-1953" is after "26-04-1981". Because "11" is after "04". The String class doesn't know anything about dates, and so alphabetic comparison is useless here. (Unless the dates had appeared in a sensible format like 1953-11-26 or 1951126, which are easily sortable as strings. But in general normal humans don't do that sort of thing, unfortunately.) To compare these strings correctly, you want to convert them to java.util.Date instances. There are several ways to do this - java.util.Calendar offers some particularly painful ways - but the easiest way is to use java.text.SimpleDateFormat:
[ July 10, 2006: Message edited by: Jim Yingst ]