Sorting ArrayList using Comparator

There is an issue with usage of Comparable interface. It can support only one sorting logic at a time. If we want to sort an array list using different sorting logic, then it is not possible with Comparable interface. Java has provided a solution to overcome this problem. This can be done using Comparator interface. … Continue reading Sorting ArrayList using Comparator