title: i cannot store more than one value in an array
body: <p>I am trying to create a program where in you can input your order and it remembers your orders and can display it if prompted. Problem is, I cannot seem to store more than one input for the history</p>
  
  <pre><code>Scanner sc = new Scanner(System.in);
      boolean a = true;
      int count = 0;
      String [] hist = new String [count+1];
  for (int i = 0; a == true; i++)
      {
      //declaration
      String [] menu = {"1. Coke", "2. Sprite", "3. Lemonade", "4. History"};     
       //this should be outside of the loop i think
  
      //displays the menu
      for (int j = 0; j &lt; 4; j++) {
          System.out.println(menu[j]);
      }
  
      //takes order
      System.out.println();
      int choice = sc.nextInt();
  
      //stores history
      if(choice != 4) 
      {
      hist[i] = menu[choice - 1];
      }
  
      //prints history
      else
      {
          for (int l = 0; l &lt; hist.length; l++)
          {
              System.out.println("You have orderd; " + hist[l]);
          }
      }
  
      System.out.println("Would you like to try again?");
      a = sc.nextBoolean();
      count++;
      }
  </code></pre>