0 votes
in JAVA by
What is the difference between Comparator and Comparable in Java?

1 Answer

0 votes
by

The Comparable interface is used to define the  natural order of object while Comparator is used to define custom order. Comparable can be always one, but we can have multiple comparators to define customized order for objects.

...