How to sort an arraylist of objects by a property?

Posted by sieve411 on Stack Overflow See other posts from Stack Overflow or by sieve411
Published on 2010-03-29T00:04:51Z Indexed on 2010/03/29 0:13 UTC
Read the original article Hit count: 638

Filed under:
|

Lets say you have an arraylist of HockeyPlayer objects. How could you sort that if they all have a variable "int goalsScored". How could you sort them by goalsScored?

© Stack Overflow or respective owner

Related posts about sorting

Related posts about java