Comparable and Comparator

China
April 24, 2011 1:20am CST
When I start to sort a collection, I can use Class - Comparable or Comparator. My question is what is difference between Comparable and Comparator?
2 responses
@jackycui (32)
• China
24 Apr 11
We can use Class - Comparable and Comparator to sort a collection. Below article is about Sorting a collection. http://www.javaol.net/2011/02/sorting-java-collections/ It can help you to understand the difference between Comparable and Comparator deeply.
• China
24 Apr 11
Thanks jackycui, your article gives me a clear cognition about Comparable and Comparator
@owlwings (43910)
• Cambridge, England
24 Apr 11
You should find this helpful: http://www.javabeat.net/qna/633-difference-between-comparable-interface-and-c/
@owlwings (43910)
• Cambridge, England
24 Apr 11
and this: http://www.velocityreviews.com/forums/t141190-difference-between-comparator-and-comparable-interface.html