Comparator in Java

Comparator Interface is a very useful interface which is used to sort the objects on some predefined conditions. Usually when we want to sort Integer type ArrayList then we use Collections.sort(arrayListName). This will sort the list of integers in ascending order. But what if we want to sort Student objects based on the marks students … Read more