Trying to sort an ArrayList of Objects by last name, then by first name if last names are the same

I created an ArrayList from an array. Objects consist of first name, last name and some other strings and an int. I am trying to sort alphabetically.

ArrayList PersonArrayList = new ArrayList<>(Arrays.asList(PersonArray));

What is the best way to go about doing this?

Trying something like:

I have created getters getLastName() and getFirstName()...

Read More »

By: StackOverFlow - 7 days ago

Related Posts