Comparable and Comparator are nearly identical in purpose: They both determine if one object is greater-than, less-than, or equal to another object. This behavior creates what is known in mathematics as a "partial ordering" and these interfaces can be used to sort lists of objects. The Comparable interface is implemented by the object type itself; whereas the Comparator is an independent class that compares two objects.