title: why am I getting the cannot find symbol when passing an array into a method
body: <p>can someone please tell me why I am getting this error when compiling?</p>
  
  <pre><code>import java.util.*;
  import java.io.*;
  public class StatsCalculator
  {
  public static void main (String[]args)
  {
      programHeader();
      randomNo(random);
      printArray(random);
  }
  
  public static void programHeader()//writes program header
  {
      System.out.println("****************");
      System.out.println("Stats calculator");
      System.out.println("****************");
  }
  
  public static int[] randomNo(int[] random)// fills an array with 10 random numbers
  {
        random = new int[10];
      for (int i=0; i&lt; random.length; i++){
          int randomNumber= (int) (Math.random()*10)+1;
          random[i] = randomNumber;
      }
      return random;
  
  
  
  
  }
  
  public static int[] printArray (int[] random)//prints array
  {
      System.out.println("Your ten random values are: ");
      for (int i=0; i&lt;random.length; i++){
          System.out.print(Arrays.toString(random));
      }
      return random;
  
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I am writing a simple program to fill and array with 10 random numbers 1-10 and then calculate the sum, mean, mode and median of all the random numbers but i can get the methods to work just to fill the array and to print the array.
  any help is appreciated.</p>