
what r the Comparator vs Comparable

Differences:
a)A comparable object is capable of comparing itself with another object while a comparator object is capable of comparing two different objects.
b)The Comparable class itself implements the java.lang.Comparable interface in order to compare its instances while the Comparator class does not compare its instances, but some other class?s instances.
For more information, visit the following links:
http://www.roseindia.net/help/java/c/comparable-interface.shtml
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.