I have an ArrayList that is a list of a class I made called "Profile". This profile contains an integer called "tokens". How can I generate an instance of this arraylist but with it organizing them by which profile has the most Tokens?
Here is my Profile class
public class Profile
{
private String name;
private int tokens;
public String getName() { return this.name; }
public int getTokens() { return this.tokens; }
}
And I have all the profiles stored in an ArrayList such as this...
public static List<Profile> PROFILES = new ArrayList<Profile>();
Any help would be most appreciated.