posted 23 years ago
I am trying to do Assignment 3.3 where we put the list of name is an ArrayList and then use the Collections class for sorting.
I am able to get the list of name in an ArrayList object and sort the list by first name using the Collections class, but I am having difficulty figuring out how to sort the list by last name since the instructions say that we have to sort without modifying the strings or the ArrayList.
From what I understand, an Array list is like a single dimensional array. If both fields (first name and last name) are in the same dimension, I don't see how the list can be sorted by anything other than the first field without modifying the strings or the ArrayList. I'm stuck.