Re: Difference between Comparator and Comparable?
Monday, December 16, 2013 09:37 PM
Comparable work on default natural sorting order
comparator work on customize sorting order
comparable present in java.lang package and it contain only one method
comarator present in java.util package and it contain two method
compare() and equals method
All wrapper class & string class implements comparable interface.
only implements class on comparator are Collator & RuleBasedCollator