To me,
equals and
compareTo both do the same basic job(comparing the objects) why does
java have two different methods for doing the same work ( i know i am missing some thing here but want to know what).
some of my questions
1.) can one class have both equals and compareTo (if yes what is the use)
2.) which one is always better to use in a class, "equals" or "compareTo"