What is the function of the sort(List list, Comparator comparator) method of the Collections class?

What is the function of the sort(List<T> list, Comparator<T> comparator) method of the Collections class?



Answer: Sorts the order of the list according to the provided Comparator object whether the list elements implement the comparable interface or not.


Learn More :

Data Structures

Learn More Multiple Choice Question :