Hi everyone,
I have an arraylist which gets populated from a database with two properties: NAME and AGE. How can I sort the arraylist by age, then by name? If I have:
maria 24
jason 30
andy 24
I need it to be sorted by age first, and then by name, so I should get the following result:
andy 24
maria 24
jason 30
(notice andy/maria alphabetically sorted).
I have tried to sort it by a property at a time, but if I do that by the time I've done the second sorting the first one is lost. I kinda need it to act like an SQL-Like ORDER BY, which won't work for me since I need to sort it after the arraylist is populated. Please let me know if you know how I can do that.
Thank you in advance
2006-06-21
06:49:28
·
4 answers
·
asked by
Dookie
3