Question: What you need to do ( Change on Main.java only; Whenever you need to implement a code, you will find a comment like this /
What you need to do Change on Main.java only; Whenever you need to implement a code, you will find a comment like this ######### Take Action Below #########
public class Employee implements Comparable
private String firstName;
private String lastName;
private String title;
private String ID;
private String level;
public String getFirstName
return firstName;
public String getLastName
return lastName;
public String getTitle
return title;
public String getID
return ID;
public String getLevel
return level;
public EmployeeString firstName, String lastName, String title, String iD String level
super;
this.firstName firstName;
this.lastName lastName;
this.title title;
ID iD;
this.level level;
@Override
public String toString
return String.formats s s s s firstName lastName, title, level, ID;
@Override
public int compareToEmployee o
return this.IDcompareTooID;
import java.ioBufferedReader;
import java.ioFileReader;
import java.ioIOException;
import java.util.ArrayList;
import java.util.Collections;
public class Main
public static void mainString args
ArrayList sorted loadEmployeeNameListcsv;
created a shuffled version
ArrayList unsorted new ArrayListsorted;
Collections.shuffleunsorted;
######### Take Action Below #########
Add codes to sort the ArrayList and try them out
Create and use an anonymous class that sorts by first name high to low
Create and use a lambda expression that sorts by last name low to high
Create and use a lambda expression that sorts by title
Create and use a lambda expression that sorts first by title then by Level
Create and use a lambda expression that sorts first by last name then by first name
Collections.sortunsorted;
######### Take Action Below #########
Use Lambda expression to print all elements of unsorted ArrayList
public static ArrayList loadEmployeeString filename
BufferedReader br null;
FileReader fr null;
ArrayList employees new ArrayList;
ArrayList lines new ArrayList;
try
fr new FileReaderfilename;
br new BufferedReaderfr;
String line;
br new BufferedReadernew FileReaderfilename;
while line brreadLine null
lines.addline;
catch IOException e
eprintStackTrace;
finally
try
if br null
brclose;
if fr null
frclose;
catch IOException ex
int count ;
for int i ; i lines.size; i
String field lines.getcountsplit;
employees.addnew Employeefield field field String.formatd i field;
count count lines.size;
return employees;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
