I'm working on a project where I have customers with reservations on a text file. I'm looking to be able to "listCustomer" them then have them come up in alphabetical order by customer name. All I have right now is:
public static void listCustomers(List<Customer> customers) {
System.out.format("\033[31m%s\033[0m%n", "Customers");
System.out.format("\033[31m%s\033[0m%n", "=========");
for (Customer c : customers) {
System.out.format("\033[33m%s\033[0m%n", "Customer");
System.out.format("\033[33m%s\033[0m%n", "--------");
System.out.println(c);
}
}
This works as it does list the customers, but it doesn't list them alphabetically as I'd like them too. I kinda new to coding so if this is a dumb way to do it let me know. Thanks :)