java output array lists to file

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

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
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();