title: Filling a linked list of objects (Nothing happens when program is run)
body: <p>I'm trying to create a linked list of customer objects but i am not entirely sure how to go about filling the list. When I run the program nothing happens and the program seems to get stuck in the while loop? I dont really know</p>
  
  <p>Here is my Customer class </p>
  
  <pre><code>public class Customer {
      private String name;
      private String address;
      private String num;
      private int year;
  
      public Customer(String name, String address, String num, int year) {
          this.name = name;
          this.address = address;
          this.num = num;
          this.year = year;
      }
      @Override
      public String toString() {
          return "Name: " + name + "\nAddress: " + address + "\nCustomer Number: " +  num + "\nLast Order: " + year;
  
  }
  }
  </code></pre>
  
  <p>And here is my tester class: </p>
  
  <pre><code>import java.io.FileNotFoundException;
  import java.util.Scanner;
  import java.io.File;
  import java.util.*;
  
  public class CustomerRunner {
      public static void main(String[] args) throws FileNotFoundException {
          String name;
          String address;
          String num;
          int year;
          Customer customer;
  
          LinkedList&lt;Customer&gt; lst = new LinkedList&lt;Customer&gt;();
  
          Scanner in = new Scanner(new File("Customers.txt"));
          Scanner input = new Scanner(System.in);
  
          while(in.hasNext()) {
              for (int i = 0; i &lt; lst.size(); i++){
                  name = in.next();
                  address = in.next();
                  num = in.next();
                  year = in.nextInt();
  
                  customer = new Customer(name, address, num, year);
                  System.out.println(customer.toString());
              //fill linkedList   
              lst.add(customer);
              }
          }
          System.out.println("1");
          System.out.println(lst.size());
  
  }
  }
  </code></pre>
  
  <p>The println(1) and println(lst.size()) are only there to try to get some sort of output.</p>
  
  <p>For reference, here is my Customers.txt</p>
  
  <pre><code>Brooke MainStreet 123456789 2016
  Adam MainStreet 234567890 2015
  Zack MainStreet 123412341 2014
  Cam MainStreet 453648576 2010
  Tanya MainStreet 121212121 2005
  Jason MainStreet 556574958 2004
  Andrew MainStreet 777777777 2012
  John MainStreet 999999999 2015
  Jeff MainStreet 555444321 2010
  </code></pre>