title: How to write ArrayList<Double> into a file in Java
body: <p>I want to write the <code>ArrayList&lt;Double&gt;</code> array into the file in such a way that when I double click on the file then the file opens and the user can read the data.</p>
  
  <p>I have tried the <code>DataOutputStream</code> &amp; <code>RandomAccessFile</code>; both works fine but when I double click on the file it shows data which is not in readable form. </p>
  
  <p>I tried this:</p>
  
  <pre><code>ArrayList&lt;Double&gt; larr=new ArrayList&lt;Double&gt;();
  larr.add(5.66);
  larr.add(7.89);
  try{
      FileOutputStream fos = new FileOutputStream("out.txt");
      DataOutputStream dos =  new DataOutputStream(fos);  
      for(Double d:larr)
          dos.writeDouble(d); 
      dos.close(); 
  } catch(Exception ex) {
      ex.printStackTrace();
  }
  </code></pre>
  
  <p>But now the case is that when I open the file <code>out.txt</code> by double clicking on it. It comes in non-readable form.</p>