The Comparator Class

The Comparator class is the base class for implementing Comparator objects that can be used with the Array sortWith() or stableSortWith() method. The compare() method implements some form of comparison that determines the relative ordering of two objects. Many Comparator implementations are specific to particular object types.

The class Comparator is a mixin class (it can be inherited by other classes), it subclasses (specializes) The Object Class .