title: Reading different lines of a txt file into different ArrayList
body: <p>I have a file with two different lines containing integer inputs. I want to read the first line of integers into an <code>Arraylist&lt;Integer&gt;</code> and the second line of input into some other <code>Arraylist</code>. How can I modify the following code to do that effectively. I am unable to understand how to use delimiter. </p>
  
  <pre><code>import java.util.*;
  import java.io.*;
  public class arr1list {
      public static void main(String[] args) throws FileNotFoundException {
          ArrayList&lt;Integer&gt; list1=new ArrayList&lt;Integer&gt;();
          File file=new File("raw.txt");
          Scanner in=new Scanner(file);
          Scanner.useDelimiter("\\D"); //the delimiter is not working.
  
          while(in.hasNext())
              list1.add(in.nextInt());
          System.out.println(list1);
          in.close();
      }
  }
  </code></pre>