Question: (11) (5 points) What does the following codes display? impert java.uta. public class Test ( public static void main(Stringt) args) PriorityQueuecintegerz queue- new PriorityQueuecintegern Arrays.astist(6o,

 (11) (5 points) What does the following codes display? impert java.uta.
public class Test ( public static void main(Stringt) args) PriorityQueuecintegerz queue- new

(11) (5 points) What does the following codes display? impert java.uta. public class Test ( public static void main(Stringt) args) PriorityQueuecintegerz queue- new PriorityQueuecintegern Arrays.astist(6o, 10, so, 30, 40, 201 while (Iqueue.isEmptyl) System.out.print(queue.polld- a. The program displays 60 10 50 30 40 20 b. The program displays 60 50 40 30 20 10 c. This problem displays 10 30 50 20 40 60 d. The program displays 10 20 30 40 50 60 e. There is no guarantee that the program displays 10 20 30 40 50 60 f. This problem fails to compile (12) (6 points) What is the output of the following code? import java.util.. public class Sortcompare t public static void main(Stringt) args) ArrayList(); list.add (new Student ("Peter", 65)); list.add(new student ("Jll", 50)); list.add(new Student ("Sarah", 34)); Collections.sort (list); System.out.print(list + " "); Collections.sort(list, new StudentComparator1)) System.out.printin(list); static class StudentComparator1 implements Comparator public int compare(student s1, Student s2) return s1.name.compareTo(s2.name); static class Student implements Comparable String name; int age Student (String name, int age) t this.namename; this.age # age; public int compareTo(Student s)( return this.age s.age; public String tostring) ( return "["+name",age"I

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!