I have seen classes which implement both Comparable and Comparator. What does this mean? Why would I use one over the other?
Difference between Comparator and Comparable interfaces
Comparable is used to compare itself by using with another object.
Comparable
Comparator is used to compare two datatypes are objects.
Comparator