title: Doing a Selection sort on an ArrayList
body: <p>I need to sort the array list from highest to lowest based on the "value" and im really stuck :(    basically in this project, they are gonna run a list of items and this method is supposed to put the one with the highest value first and so fort and im trying to use a selection sort. Thank for you help in advance :) here is what i have at the moment</p>
  
  <pre><code>public void pickMostExpensiveFirst(ArrayList&lt;Item&gt; totalListOfItems)
  {
      int max, i ,j;
      Item temp;
  
      for (i = 0; i &lt; totalListOfItems.size() - 1; i++)
      {
          max = i;
  
          for (j = i + 1; j &lt; totalListOfItems.size(); j++)
          {
              if (totalListOfItems.get(max).getValue()
                      .compareTo(totalListOfItems.get(j).getValue()) &gt; 0)
                  max = j;
          }
  
          temp = totalListOfItems.get(i);
          totalListOfItems.set(i, totalListOfItems.get(max));
          totalListOfItems.set(max, temp);
      }
  }
  </code></pre>