In Java: Create a Graduate class derived from Student. A graduate has an attribute (a String) called degree, which is either "Masters" or "Doctorate", and a boolean called thesis (meaning whether they have completed their thesis and initially set to false). Write all methods . Sort students, undergrads and grads according to ID. Sort Faculty according to Department and Staff according to Salary. undergrad.inDownload undergrad.in graduate.inDownload graduate.in staff.inDownload staff.in faculty.in import java.io.File; import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; public class H9 { public static void main(String[] args) { /******************************* * UNDERGRADUATES * ***************************/ File inFile = new File("undergrad.in"); Scanner fileInput = null; try { fileInput = new Scanner(inFile); } catch (FileNotFoundException ex) { //Logger.getLogger(Lab10.class.getName()).log(Level.SEVERE, null, ex); } //create an arrayList ArrayList<Undergraduate> myList = new ArrayList<Undergraduate>(); //input into the ArrayList while(fileInput.hasNext()) { int id=fileInput.nextInt(); int lev=fileInput.nextInt(); String name=fileInput.nextLine(); Undergraduate s=new Undergraduate(name, id, lev); myList.add(s); } //sort the arrayList Collections.sort(myList); //Output the sorted list System.out.println("*************************************"); System.out.println("The undergrads sorted according to ID"); System.out.println("*************************************"); for(int i=0; i<myList.size(); i++) { myList.get(i).writeOutput(); System.out.println(); } //close the input file fileInput.close(); /******************************* * GRADUATES * ***************************/ inFile = new File("graduate.in"); try { fileInput = new Scanner(inFile); } catch (FileNotFoundException ex) { //Logger.getLogger(Lab10.class.getName()).log(Level.SEVERE, null, ex); } //create an arrayList ArrayList<Graduate> myList2 = new ArrayList<Graduate>(); //input into the ArrayList while(fileInput.hasNext()) { int id=fileInput.nextInt(); String lev=fileInput.next(); String thesis=fileInput.next(); boolean t; if(thesis.equals("yes")) t=true; else t=false; String name=fileInput.nextLine(); Graduate s=new Graduate(name, id, lev, t); myList2.add(s); } //sort the arrayList Collections.sort(myList2); //Output the sorted list System.out.println("*************************************"); System.out.println("The grads sorted according to ID"); System.out.println("*************************************"); for(int i=0; i<myList2.size(); i++) { myList2.get(i).writeOutput(); System.out.println(); } //close the input file fileInput.close(); /******************************* * Faculty * ***************************/ inFile = new File("faculty.in"); try { fileInput = new Scanner(inFile); } catch (FileNotFoundException ex) { //Logger.getLogger(Lab10.class.getName()).log(Level.SEVERE, null, ex); } //create an arrayList ArrayLis.