I wnt d diffrence bet 'em....
The equals() method just checks whether two objects are equal or not. The compare()
method defines an 'order' of elements e1 < e2 < e3 ... en. If e1,compare(e2)
is less than zero then e1 < e2; if it returns greater than zero then e2.compare(e1)
returns less than zero so e2 < e1. Otherwise both are considered equal and then
e1.equals(e2) == e2.equals(e1) == true.
The compare() method imposes a 'stronger' relation between two objects than
the equals() method does.
kind regards,
Jos