I have an arrayList of firstName, lastName, address, email, and phoneNumber and an arrayList of multiple "entries" each with all 5 of those indexes. The methods to get and set all 5 of those values are all in the Entry class while adding, modifying, deleting, and sorting entries is done in the class Contact List.
I'm trying to sort the entries by last name and print them out in the ContactList class. I have:
public void listEntries()
{
Collections.sort(entries);
for (int i = 0; i < entries.size(); i++)
{
entries.get(i).print();
}
}
I know I'm missing something to define what to sort by, but I'm not even sure if I should be using Collections.sort. Any suggestions?