import java.util.Arrays;

    // Illustrate use of Arrays.sort on an array of objects
    // that implement the Comparator interface.
class ComparatorMain {
    public static void main(String[] args){
        final Student[] students = {
            new Student("Hobart",50),
            new Student("Battlement",50),
            new Student("Barking",0),
            new Student("Upminster",100),
        };
        // Sort the data using a Comparator.
        Arrays.sort(students,new ComparatorExample());
        // Demonstrate that it has been sorted.
        final int numStudents = students.length;
        for(int i = 0; i < numStudents; i++){
            System.out.println(students[i].toString());
        }
    }
}
