title: How to Create a new array each cycle of a for loop
body: <p>Hello im looking at how to create a new array and store the two values obtained from the user each iteration of the for loop. Since it goes from 1-4 i want to create 4 arrays and each time it appends the values the user gives in that iteration. If it would be better to create one big array that stores all the values, please share however I would like to keep the code simple. The example below shows my code, the array part is the part im having issues with at the moment.</p>
  
  <pre><code>import java.util.Scanner;
  
  public class Arrays{
  
  public static void main(String args[])
  
  String array1[];
  String array2[];
  String array3[];
  String array4[];
  
  for (int i=1; i &lt;5; i++) {
  
      System.out.println("What is track " + i);
      Scanner sc = new Scanner(System.in);
      String track = sc.nextLine();
      System.out.println("How many thousands of times has it been downloaded? ");
      Scanner sd = new Scanner(System.in);
      String time = sd.nextLine();
      array1[0]=track;
      array1[1]=time;
  
  }
  System.out.println(arrays1);
  System.out.println(arrays2);
  System.out.println(arrays3);
  System.out.println(arrays4);
  }
  </code></pre>