Multiple Choices
(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 02) {
return 01.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);