is there ever a reason to implement `Comparable` i...
# getting-started
h
is there ever a reason to implement
Comparable
in kotlin when you can just use
compareTo
operator?
s
Java interop, perhaps
b
For an library API, so a client can pass you things
t
Comparable
is used for sorting items in a
SortedSet
or
SortedMap
(but you can still provide a
Comparator
).
h
thanks for all the answers!