

Hi,
Here is the answer.
We implement the Comparable interface to provide a natural sorting order. For those classes without a natural order, or when you desire a different order than the natural order, you can implement the Comparator interface to define your own.
To take advantage of the sorting capabilities, the Collections Framework provides two interfaces that use it: SortedSet and SortedMap.
Thanks.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.