How to use Comparator and Comparable in Java? With example Comparators and comparable in Java are two of fundamental interface of Java API which is very important to understand toimplement sorting in Java. It’s often required to sort objects stored in any collection class or in Array and that time we need to use compare () andcompare To () method defined in java.util.Comparator and java.lang.Comparable class.
Read full article from JDK 7: How to use Comparator and Comparable in Java? With example
No comments:
Post a Comment