Collections.sort()
method is used the elements get sorted based on the natural order that is specified in the compareTo()
method. On the other hand when Collections.sort(Comparator) method is used it sorts the objects based on compare()
method of the Comparator interface.