title: How do I add String elements from a text file into an ArrayList?
body: <p>The text file contains numbers separated by commas (ex. 458.58, 1598.45...).</p>
  
  <p>I want to add an entire line from the text file into an ArrayList.</p>
  
  <p>Here is my code so far:</p>
  
  <pre><code>// to calculate final output
  ArrayList&lt;String&gt; weeklySales = new ArrayList&lt;String&gt;(7);
  
  // week 1 sales
  while(file.hasNext()) {
      weeklySales.add(file.nextLine());
      System.out.println("I ran!");
  }
  
  System.out.println(weeklySales);
  </code></pre>
  
  <p>EDIT: Sorry my question wasn't clear. My question is after running this code, it adds ALL the elements of the ENTIRE text file into my array, BUT I need to only add 1 LINE to its own individual ArrayList. So in total I will have as many array lists as there are lines of text in the file.</p>