From charlesreid1

Revision as of 22:58, 22 June 2017 by Admin (talk | contribs)

Comparable is the interface that is implemented in order for objects to be comparable using operators like < > == etc.

https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html

This is a generic type interface, and can be used to define a class that can be compared using custom criteria. For example, we can organize a list according to a very specific method of ordering (right-to-left, filling in with "ghost" titles, as in the Classy problem), or according to custom criteria like when a Cartesian (x,y) point would be visited by a space-filling curve, as with the Hilbert Sort problem.






See also: