title: Sorting objects by a value within them
body: <p>I have an array of objects, these objects all have multiple values stored within them. I have them within an object array. </p>
  
  <pre><code>class PlayerScores {
  
  String playerName;
     int pos=0;
     int played=0;
     int win=0;
     int draw=0;
     int lose=0;
     int goalsFor=0;
     int goalsAgainst=0;
     int goalDifference=0;
     int points=0;
  
     public PlayerScores() {
     }
  }
  </code></pre>
  
  <p>These are stored within the array:</p>
  
  <pre><code>Player Scores[] playersObjects = new PlayerScores[int];
  
              playersObjects[i] = new PlayerScores();
  </code></pre>
  
  <p>I want to search through 'playersObject[]' and order then in a new object array with the Player with the highest points first in the array and the rest in descending order. I am not sure how to run a sort on a single value within an object.</p>
  
  <p>Any help would be massively appreciated, </p>
  
  <p>Thanks.</p>