title: How do you save user input inside an array?
body: <p>I'm trying to write a that program asks the user to enter the number of patients to be saved in a hospital's database, which is <code>ArraySize</code> . The user must enter the patient's ID, first and last name, and then the patient's ID, first and last names are indexed in the array according to the severity of his/her condition. My question is how do I save the user's ID input to be a part of the entire ID array, whose limit is as entered by the user? How do I index the patient's information? </p>
  
  <p>Here's my code so far: </p>
  
  <pre><code>System.out.print("\n &gt; How many patients allowed for day 25-12-2016 : ");
          int ArraySize = input.nextInt();
  
   System.out.print("\n       &gt; Enter patient ID: ");
                  int ID[] = new int[ArraySize];
  
                  for (int i = 0; i &lt; ID.length; i++) {
                      ID[i] = input.nextInt();
                  }
  
  
     System.out.print("\n         &gt; Enter patient First Name: ");
              String first[] = new String[ArraySize];
              for (int i = 0; i &lt; first.length; i++) {
                  first[i] = reader.nextLine();
              }
              System.out.print("\n        &gt; Enter patient last Name: ");
              String last[] = new String[ArraySize];
              for (int i = 0; i &lt; last.length; i++) {
                  last[i] = reader.nextLine();
              }
  
   System.out.print("\n _______________________________________________\n"
                  + "|                                               |\n"
                  + "|                  Case Type                    |\n"
                  + "|_______________________________________________|\n"
                  + " \n"
                  + " _______________________________________________\n"
                  + "|                        |\n"
                  + "| 1: Enter 1 for Accident Injury                | \n"
                  + "| 2: Enter 2 for Fire Injury                    | \n"
                  + "| 3: Enter 3 for Electricity Sho                | \n"
                  + "| 4: Enter 4 for Heart Attack                   | \n"
                  + "| 5: Enter 5 for Unconscious                    | \n"
                  + "| 6: Enter 6 for Otherwise                      | \n"
                  + "|_______________________________________________|\n"
                  + " &gt; Please enter your choice: \n"
                  + " ");
  int choice = input.nextInt();
  
  if (int==1)
  
  {
  // index patient at 0 
  
  }
  </code></pre>