Question: 16. [10 marks] You are given the following Student class. class Student { } private int labID; private String tutID; Student (int labID, String
16. [10 marks] You are given the following Student class. class Student { } private int labID; private String tutID; Student (int labID, String tutID) { this.labID = labID; this.tut ID = tut ID; } public int getLabID () { return this.labID; } public String getTutID () { return this.tut ID; } @Override public String toString () { } return labID + " " + tutID; (b) [2 marks] Define a List of comparators comparatorList to store the comparators in question 16a. (c) [3 marks] Design the Student Comparator class that implements the interface java.util.Comparator to perform the sorting method as represented in the list of comparators in question 16b. (d) [2 marks] Write a program fragment to show how the following list of four stu- dents can be sorted by lab group, then by tutorial group, and printed out. Student in lab group 1, and tutorial group a2 Student in lab group 3, and tutorial group b1 Student in lab group 3, and tutorial group a2 Student in lab group 1, and tutorial group b1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
