java output array lists to file

Solutions on MaxInterview for java output array lists to file by the best coders in the world

showing results for - "java output array lists to file"
Giorgia
08 Nov 2017
1import java.io.FileWriter;
2...
3FileWriter writer = new FileWriter("output.txt"); 
4for(String str: arr) {
5  writer.write(str + System.lineSeparator());
6}
7writer.close();