Here you can find the source of save(String fileName, List
public static void save(String fileName, List<String> list) throws FileNotFoundException
//package com.java2s; //License from project: Open Source License import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.PrintWriter; import java.util.List; public class Main { public static void save(String fileName, List<String> list) throws FileNotFoundException { PrintWriter pw = new PrintWriter(new FileOutputStream(fileName)); for (String title : list) pw.println(title);//from w ww. j a va2 s. c o m pw.close(); } }