How to write a LocalDate list to a file in java? : <p>I'm trying to write a LocalDate list to an output file, i've got <code>List&lt;LocalDate&gt; fechas</code> but when i try this code:</p>

<pre><code>FileWriter writer = new FileWriter("output.txt"); 
        for(LocalDate str: fechas) {
          writer.write(str);
        }
        writer.close();
</code></pre>

<p>it doesn't compile</p>
