public static void main(String[] args) {
ArrayList<Employee> unsorted = loadEmployee("NameList.csv", 100);
Collections.sort(unsorted,(Employee o2, Employee o1)-> o1.getFirstName().compareTo(o2.getFirstName() ));
unsorted.forEach((Employee)-> System.out.println(Employee));
This prints first name in alphabetical order. But how do you sort first name first then by ID?
I have Employee
class and have String ID, String firstName
.
Learning Collections.sort
here.