(Choose 1 answer)
}
Read the following program
import java.util.*;
class Student {
private String name;private int age;
public int getAge() { return age;}
public Student(String name, int age) { this.name = name;this.age = age;}
public String toString(){
return "Name = " + name + ", Age = " + age;}
class SortByAge implements Comparator<Student> { @Override
public int compare(Student 01, Student o2) { } return o1.getAge() - o2.getAge();
public class Main {
public static void main(String[] args) {
Student] Is = new Student[3];
Is[0] = new Student("A", 25);Is[1] = new Student("B", 20);
Is[2] = new Student("C", 22);
Arrays.sort(ls, 0, 2, new SortByAge());
for(Student s: Is)System.out.println(s);
}
Ext (20)