title: Reading txt file data into doubles
body: <p>I am trying to save data in a text file to an array containing doubles. I have made it work for integers, but I want to add non integer data and so far I can't figure out. Here is my code so far:</p>
  <p>public class MainClass {</p>
  <pre><code>public static void main(String[] args) throws FileNotFoundException {
      List&lt;Double&gt; E0 = Arrays.asList();
      List&lt;Double&gt; E1 = Arrays.asList();
      List&lt;Double&gt; E2 = Arrays.asList();
      List&lt;Double&gt; C = Arrays.asList();
      BufferedReader reader;
      try {
          reader = new BufferedReader(new FileReader(&quot;C:\\Data.txt&quot;));
          String line = reader.readLine();
          while (line != null) {
              Double lineParts = line.split(&quot;,&quot;);
              E0.add(lineParts[0]);
              E1.add(lineParts[1]); 
              E2.add(lineParts[2]);
              C.add(lineParts[3]);
              line = reader.readLine();
          }
          reader.close();
          } catch (IOException e) {
              e.printStackTrace();
          }
          System.out.println(E0);
          System.out.println(E1);
          System.out.println(E2);
          System.out.println(C);
      }
  
  }
  </code></pre>
  <p>Here is my data:</p>
  <p>1,1,4,-1<br />
  1,2,9,1<br />
  1,5,6,1<br />
  1,4,5,1<br />
  1,6,7,-1<br />
  1,1,1,-1</p>