title: JAVA - Menu running in loop - How can I print out all choices?
body: <p>I'm trying to learn JAVA and I'm working on a simple pizza order assignment running purely in text/console format.</p>
  
  <p>I've made the user chose a pizza, but they need the option to add extra ingredients. </p>
  
  <p>My thought was to use a for loop to show a toppings menu and then ask for a numbered input matching the ingredient they want to add. </p>
  
  <p>I want them to be able to select several ingredients, why I'm doing it in a loop. </p>
  
  <p>My code as of now looks like this: </p>
  
  <pre><code>for (int i = 0; ingredientInput&gt;0; i++ ){
              toppingsMenu();
              ingredientInput = ingredientScan.nextInt();
              ingredientScan.nextLine();
              System.out.println("Type your choice here:");
          }
          System.out.println(ingredientInput);
  </code></pre>
  
  <p>Everything works great, but I'd like to add a system.out.println() telling the user, what they've chosen as:</p>
  
  <p><em>"You've added extra cheese - Would you like to add more?"</em>
  If so, I would like to expand that sentence: <em>"You've added extra cheese &amp; pepperoni - Would you like to add more?"</em></p>
  
  <p>Could you help me by pointing me in a direction that might work? I'm not into any object related part of JAVA yet, purely text-based so far. </p>
  
  <p>Thanks.</p>
  
  <p><strong>Solution provided by Adeel Ahmad</strong></p>
  
  <pre><code>ArrayList&lt;Integer&gt; ingredients = new ArrayList&lt;&gt;(); 
  for (int i = 0; ingredientInput&gt;0; i++ ){
          toppingsMenu();
          ingredientInput = ingredientScan.nextInt();
          ingredientScan.nextLine();
          ingredients.add(ingredientInput);
          System.out.println("Type your choice here:");
      }
      System.out.println(ingredientInput);
  </code></pre>
  
  <p>Looking back it's so interesting to see which problems I struggled to solve, as now, a few months later, this seems so basic. But thanks anyway to everyone who helped :D</p>