title: Sum of ten random numbers
body: <p>So far, my code looks like this: </p>
  
  <pre><code>import java.util.Random;
  public class StatsCalculator
  {
    public static void main(String[] args)
    {
      Random r = new Random();
      System.out.println("The ten random values are: ");
      for(int i=0; i&lt;10; i++)
      {
        int randomint = r.nextInt(10);
        System.out.print(" ," + randomint);
      }
  
      int randomint[];
      int sum=0;
      for(int i : randomint)
      {
        sum += i;
        System.out.println("Sum = " + sum);
      }
    }
  } 
  </code></pre>
  
  <p>When I run this code, there's an error message come up that say's the following: "variable <code>randomint</code> might not have been initialized, <code>for (int i : randomint)</code></p>