title: How to write an ArrayList<String[]> to a .csv file in Java?
body: <p>Say I have an ArrayList of String arrays like so:</p>
  <pre><code>    ArrayList&lt;String[]&gt; arrayList = new ArrayList&lt;String[]&gt;();
      arrayList.add(new String[]{&quot;hello&quot;, &quot;goodbye&quot;});
      arrayList.add(new String[]{&quot;yoyo&quot;, &quot;fofo&quot;});
      arrayList.add(new String[]{&quot;foo&quot;, &quot;bar&quot;});
  </code></pre>
  <p>What would be the simplest way to conver this to a .csv file in Java? I had some data that I manipulated to this particular data structure since ArrayLists are dynamic and I used String arrays inside since the number of columns in the data won't change, and we can just keep adding more arrays to the ArrayList for every new 'row' in the .csv output.</p>