title: Users Value Won't Store In Array
body: <p>So I have this assignment called &quot;ChangeUp&quot; and I have to randomize an index then add in the users value in the array. I already did most of the code, unless I did it wrong, but I just can't add the users number in the index.</p>
  <blockquote>
  <p>Create an empty int array of size 6. Create a method called
  populateArray that will pass an array, use random class to choose a
  random index and prompt the user to enter a value, store the value in
  the array. Note: Generate 6 random index numbers in an attempt to fill
  the array.  Create a method called printArray that prints the contents
  of the array using the for each enhanced loop.</p>
  </blockquote>
  <pre><code>import java.util.*;
  
  public class ChangeUp {
  
      public static void main(String[] args) {
          int[] hairline = new int[6];
          populateArray(hairline);
          printArray(hairline);
      }
  
      private static void populateArray(int[] hairline){
          Random TNT = new Random();
          Scanner kirby = new Scanner(System.in);
          System.out.format(&quot;Enter %d numbers:\n&quot;, hairline.length);
          int goo = TNT.nextInt(6);
          int user = kirby.nextInt();
          int i = 0;
          for(i = 0; i &lt; hairline.length-1; i++){
              hairline[i] = TNT.nextInt(6);
          }
      }
  
      private static void printArray(int... hairline){
          System.out.print(&quot;{&quot;);
          for(int i : hairline){
              System.out.print( i  + &quot; &quot; );
          }
          System.out.println(&quot;}&quot;);
      }
  }
  </code></pre>