Given the code fragment:
What is the result?
[X][X, X][X, X, X][X, X, X, X]
[X, X]
[X][X, X][X, X, X]
[X, X][X, X, X, X]
Given the code fragments:
and
Which two modifications enable to sort the elements of the emps list? (Choose two.)
Replace line n1 withclass Person extends Comparator
At line n2 insertpublic int compareTo (Person p) {return this.name.compareTo (p.name);}
Replace line n1 withclass Person implements Comparable
At line n2 insertpublic int compare (Person p1, Person p2) {return p1.name.compareTo (p2.name);}
At line n2 insert:public int compareTo (Person p, Person p2) {return p1.name.compareTo (p2.name);}
Replace line n1 withclass Person implements Comparator