title: java comparing integers as strings with a comparator - odd results
body: <p>I'm attemping to compare some players with a comparator by the amount of runs they have obtained.</p>
  
  <pre><code>System.out.println("Comparing: " + p2.getRuns() + " and " + p1.getRuns());
  int newRESULT = intConvert(p2.getRuns()).compareTo(intConvert(p1.getRuns()));
  System.out.println("Returns: " + newRESULT);
  return newRESULT;
  </code></pre>
  
  <p>However this returns:</p>
  
  <p>Comparing: 25 and 0,
  Returns: 2</p>
  
  <p>Comparing: 0 and 100,
  Returns: -1</p>
  
  <p>Comparing: 25 and 100,
  Returns: 1</p>
  
  <p>...and hence orders the players in the wrong order.</p>
  
  <p>Should the first comparison not return 1, the second -1 and the last -1 as well?</p>
  
  <p>intConvert:</p>
  
  <pre><code>     private static String intConvert(int x)
       {
        return "" + x;
       }
  </code></pre>