title: Reading file to ArrayList
body: <p>I'm trying to write a .dat file to an ArrayList. The file contains lines formatted like this : #name#,#number#.</p>
  
  <pre><code>Scanner s = new Scanner(new File("file.dat"));
  while(s.hasNext()){
      String string = s.next();
      names.add(string.split(",")[0];
      numbers.add(Integer.parseInt(string.split(",")[1];
  }
  </code></pre>
  
  <p>If I check if it runs with printing, all I get is the first line.</p>