title: User input to populate an array one value at a time JAVA
body: <p>I am trying to figure out how to take input from a user and store it into an array. I cannot use an <code>arrayList</code> (the easy way lol) but rather a standard <code>array[5]</code>. I have looked on here and on google and because of the sheer amount of questions and responses I have yet to find a good answer. Using scanner to get input is not a problem. Storing the input in an array is not the problem. What i am having trouble with is that I need to store one input at a time.</p>
  
  <p>Currently I was using a for loop to gather information but it wants to gather the entire array at once.</p>
  
  <pre><code>    for (int i=0;i&lt;5;i++)
                  array[i] = input.nextInt();
  
      for (int i=0;i&lt;array.length;i++)
                  System.out.println(array[i]+" ");
  </code></pre>
  
  <p>I have been messing around with it, but if i remove the first for loop, im not sure what to put in the array[] brackets. BlueJ just says that "array[] is not a statement"</p>
  
  <p>How can I accept just one value at a time and let the user determine if they want to do the next?</p>
  
  <p>This is for a homework assignment, but the homework assignment is about creating a console with commands of strings and this is a concept that i need to understand to complete the rest of the project which is working fine.</p>