Comparable and Comparator – a detailed discussion

Introduction This article is in response to a question asked on one of the groups I am a member of. What is the difference between Comparable and Comparator interfaces in Java. Why there are two interfaces if what they do is provide a method to compare. This might not seem to be a topic worth discussion for people who are experts in java, but yeah for many of my friends out there, it might help. Purpose of the article The article will describe in detail the difference between the interfaces Comparable and Comparator and also define the usages of both of them. One thing we need to underst...
Read More