Original Post
I'm trying to think of how I can order objects based on an instance variable in each one. Let's say I have a class called Task, and each Task object has an int variable 'priority'. How could I sort all the task objects from highest priority to lowest? I'm currently using 3 boolean variables and a handful of if statements, but I know this is a horrible way of doing this. An array would make it much easier, but I am not sure of how to go about sorting an array of Task objects based on their 'priority' variable. Can anyone point me in a direction of where to start on this? Thanks for any help.