title: JAVA: Passing an array to a method
body: <p>I can't seem to pass my array to a secondary method. It only sees one of the 10 inputs, so I can't properly use it in the secondary method. </p>
  
  <pre><code>public static void main(String[] args) {
      java.util.Scanner input = new java.util.Scanner(System.in);
      System.out.println("Enter some numbers: ");
      double [] numbers = new double [10]; 
      int n = 0; 
      int i = 0;
      while(n &lt; numbers.length) { 
          numbers[i] = input.nextDouble(); 
          n+=1; 
      }
      System.out.println(min(numbers));
  } 
  
  public static double min(double[] array) { 
      System.out.println(array[1]);
      double smallest = array[0];
      for (int l = 1; l &lt; array.length; l++) { 
          if (array[l] &lt; smallest) { 
              smallest = array[l]; 
              System.out.println("Your smallest = " + smallest);
          }
  
      }
      return 0; 
  }
  </code></pre>