title: incompatible types - double to int?
body: <p>Java seems to think that I am attempting to convert or perform some kind of action on one of my double variables. I get the error message</p>
  
  <blockquote>
    <p>average2.java:23: error: incompatible types: possible lossy
    conversion from    double to int scores[count++]=score;</p>
  </blockquote>
  
  <p>I am really confused in that I have not declared anything as an integer thus far, - every variable is a double because I expect to have some decimals.    Below is my code :</p>
  
  <pre><code>public static void main (String [] args)
  {
  
      double numOf;
      double lowest = 100;
      double count = 0;
      double sum = 0;
  
      double average = 0;
      double score;
  
      double scores[] = new double[100]; //[IO.readDouble("Enter Scores, Enter -1 to Quit")];
  
      while ((count &lt;100) &amp;&amp;(( score =IO.readDouble("Enter Scores,  (-1 to Quit")) &gt; 0));
      {
          scores[count++]=score;
      }
  
      //This section obtains the highest number that was entered`
      double max = scores[0];
      for (double i=0; i&lt;scores.length; i++)
          if(max &lt; scores[i])max =scores[i];
  
      System.out.println("Maximum is " + max);    
  
      // This section obtains the lowest score entered    
      double min = scores[0];
      for (int i=0; i&lt;scores.length; i++)
          if (min &gt; scores[i]) min = scores [i];
  
      int sumOf =0;
      for (int i=0; i &lt; scores.length; i++)
      {    
          sumOf += scores[i];     
      }
      System.out.println("The sum of all scores is  " + sumOf);
  
      System.out.println("Minimum is " + min);
  
      count = count + 1;                     
  
      average =  (sumOf/scores.length);     
      System.out.println("Average is " + average);
  } //end main      
  } //end class     
  </code></pre>