Q. Which interface must a class implement to use the Comparable sorting?

A
Comparator
B
Comparable
C
Sortable
D
Iterable
Solution:

The Comparable interface provides the compareTo() method for natural ordering of objects.

Entri Contact Image

Get Expert Advice for Free: Register for Your Free Consultation Now!