Comparable 1) Comparable provides only one sort of sequence. 2) It provides one method named compareTo(). 3) It is found in java.lang package. 4) If we implement Comparable interface, actual class is modified. Comparator 1) Comparator provides multiple sort of sequences. 2) It provides one method named compare(). 3) it is found in java.util package. 4) Actual class is not modified.
Can you answer this question?
Write Answer1 Answers