Question 21
Consider the code given below.
import java.util.*;public class Person{ private String name; private int age; public Person(String n, int a) { name = n; age = a; } public int getAge(){ return age; } public void print() { System.out.println(name + " : " + age); }}public class FClass{ public static void main(String[] args) { var list = new ArrayList<Person>(); list.add(new Person("Robin", 33)); list.add(new Person("Indra", 76)); list.add(new Person("Smita", 35)); list.add(new Person("Rikki", 26)); Collections.sort(list, __________________________); LINE 1 for(var l: list) l.print(); }}Identify the appropriate option(s) to fill in the blank at LINE 1, such that the output is:
Indra : 76
Smita : 35
Robin : 33
Rikki : 26