title: Printing an array list using ListIterator
body: <p>I am trying to print from an ArrayList using an ListIterator, i'm pretty sure i'm doing it wrong because it's not working but I don't know how to fix it. All so the line that grabs the part number isn't working, not sure why ;P. Any help is always appreciated :).</p>
  
  <pre><code>package invoice;
  import static java.lang.System.out;
  
  import java.util.*;
  
  public class InvoiceTest {
  
  
      public static void print(){
  
      }
  
      public static void main (String args[]) {
  
          Scanner imput = new Scanner (System.in);
          ArrayList lInvoice = new ArrayList() ;
          int counter = 0;
          int partCounter;
  
          out.println("Welcome to invoice storer 1.0!");
          out.println("To start please enter the number of items: ");
          partCounter = imput.nextInt();
  
  
          while (counter &lt; partCounter){
              counter++;
              out.println("Please enter the part number:");   
              Invoice invoice1 = new Invoice(); //Makes invoice 1 use the invoice class
              String partNumber = imput.nextLine();// sets part number to the next imput
              //invoice1.setPartNumber(partNumber);// Sets it to the private variable in invoice.java
              lInvoice.add(partNumber);
  
              out.println("Please enter in a discription of the part: ");
              String partDis = imput.nextLine();
              //invoice1.setPartDis(partDis);
              lInvoice.add(partDis);
  
              out.println ("Please enter the number of items purchased: ");
              int quanity = imput.nextInt();
              //invoice1.setQuanity(quanity);
              lInvoice.add(quanity);
  
              out.println ("Please enter the price of the item:");
              double price = imput.nextDouble();
              //invoice1.setPrice(price);
              lInvoice.add(price);
  
          }
  
          ListIterator&lt;String&gt; ltr = lInvoice.listIterator();
          while(ltr.hasNext());
          out.println(ltr.next());
      }
  }
  </code></pre>