title: Sorting in Java
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/5506471/selection-sorting-string-arrays-java">Selection Sorting String Arrays (Java)</a>  </p>
  </blockquote>
  
  
  
  <p>I have a list of cards </p>
  
  <pre><code>clubsArray = {TC, KC, 7C, AC}
  </code></pre>
  
  <p>These stand for (ten of clubs, king of clubs, 7 of clubs and ace of clubs) 
  I want to know how to sort them and get an output like this,</p>
  
  <p>AC, KC, TC, 7C</p>
  
  <p>I tried doing this to sort it ... </p>
  
  <pre><code>private String clubsOutput = "";
      public void clubsSort()
          {
            String order = {"A","K","Q","T","9","8","7","6","5","4","3","2","1"};
              for (int i = 0; i &lt; clubsArray.length; i++)
              {
                  temp = clubsArray[i].charAt(0); // Gets the value of the card 
                  tempS = Character.toString(temp); // Holds the character
  for (int x = 0; x &lt; order.length; x ++)
  {
  if (tempS.equals(order[x])
  {
  clubsOutput = clubsOutput + clubsArray[i]+ " , "; 
  }
  }
  </code></pre>
  
  <p>i cant seem to solve this </p>