title: Java CompareTO with double Values
body: <p>I need to be able to rearrange a group of people from their overall fitness score. I am able to do a compareTO method with ints but as soon as its with doubles I get errors flying up everywhere. </p>
  
  <pre><code>public double compareTo(FitnessScore o){
      return (this.overall-o.overall);
  }
  </code></pre>
  
  <p>It needs to be a double because there are scores like:</p>
  
  <pre><code>68.5 68.4 60.1 60.3
  </code></pre>
  
  <p>So casting them to an int would make it redundant. When I did have it as an int to see if it would work. I tried the following. (subjects being the array that I initialized to hold all the different instances of people)</p>
  
  <pre><code>Arrays.sort(subjects);
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>java.lang.NullPointerExceptione
  </code></pre>
  
  <p>Any suggestions?</p>