I'm attempting to sort an ArrayList
of BountyObject
s by their property .getAmount()
which returns a double
..
I've looked at a similar question on here and it's not pointing me in the right direction, could anyone explain how I would sort this:
List<BountyObject> sortedList = new ArrayList<BountyObject>();
for (BountyObject bo : bounties) // Where bounties is the original list of unsorted objects
{
// Sort them into the sorted list by bo.getAmount() - highest to lowest value
}
Any help would be greatly appreciated, thank you