title: Creating an ArrayList Grocery List And Displaying Results in a table
body: <p>I have been working on this assignment for weeks and need some assistance. Please don't refer me to JavaDocs as I have reviewed them countless times and have been unable to find the solution to my program. 
  This is what I need to do: </p>
  
  <ol>
  <li>Add items to the ArrayList, one at a time, based on user typed input. The user will be prompted for the String to be stored in the ArrayList and then hit enter. The user will be able to continue to add items to the ArrayList until they just hit enter without typing anything.</li>
  </ol>
  
  <p>Once the user does this (hits enter without typing anything), the program will display all of the elements of the ArrayList, both the index and String values, in a table. It will do this via a single loop</p>
  
  <p>This is the code that I have so far: </p>
  
  <pre><code>import java.io.BufferedReader;
  import java.io.IOException;
  import java.io.InputStreamReader;
  import java.util.Scanner;
  import java.util.ArrayList;
  
  // declares a name for the class
  public class GroceryList2 {
      /**
       * Allows the program to be run and throws the Input-Output exception
       * error
       */
      public static void main(String[] args) throws IOException {
          BufferedReader userInput =
             new BufferedReader( new InputStreamReader(System.in));
          Scanner in = new Scanner(System.in);//allows for input
          // declares the ArrayList to be a String
          ArrayList&lt;String&gt; myArr = new ArrayList&lt;String&gt;();
          myArr.add("Milk");
          myArr.add("Cheese");
          myArr.add("Eggs");
          myArr.add("Bread"); //the values of the ArrayList already entereed
         // the loop that allows the criteria to run
          while(true) {
             if(myArr.isEmpty()== false ) {
                System.out.println("Enter the items for the grocery list: ");
                String item = in.next();//asks and allows for input
                myArr.add(item);
             }
             else if(myArr.isEmpty()== true ) {
                for (int i=0; i&lt;myArr.size(); i++ ) {
                   // displays the list after the input
                   System.out.print(
                      "The Grocery List "+ i+ ": "+ myArr.get(i));
                }
             }
          }
       }
    }
  </code></pre>
  
  <p>The code compiles, but when I just press enter, it doesn't display the grocery list, it waits for another entry.</p>