I would like to sort some class objects alphabetically and want to know if there is an easy way to do it.
I have classes like Person.class which has variables like:
int id
String name
(Getters and setters for both)
Then I have a hashSet of Person.class objects and I want to return them sorted alphabetically.
Is there a relatively simple way to do this?
Thanks.
I have classes like Person.class which has variables like:
int id
String name
(Getters and setters for both)
Then I have a hashSet of Person.class objects and I want to return them sorted alphabetically.
Is there a relatively simple way to do this?
Thanks.