Difference between Comparator and Comparable?...
arnavkumarMon Nov 04, 2013 10:49 PM
Thanks in advance
Report | Quote This | Send private message | Reply | Print
Comparable work on default natural sorting order&n...
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