how to write an arraylist into a text file?
<p>I want to write an <code>ArrayList</code> into a text file. How to add "arr" ArrayList's item to a text file?</p>

<p>The <code>ArrayList</code> is created with the code:</p>

<pre><code>ArrayList arr = new ArrayList();

StringTokenizer st = new StringTokenizer(line, ":Mode set - Out of Service In Service");
while(st.hasMoreTokens()){
    arr.add(st.nextToken());    
}
</code></pre>
