Java PrintWriter Write save(String fileName, List list)

Here you can find the source of save(String fileName, List list)

Description

save

License

Open Source License

Declaration

public static void save(String fileName, List<String> list) throws FileNotFoundException 

Method Source Code


//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();
    }
}

Related

  1. save(final Multimap map, final Writer target, final String sep)
  2. save(Map map, String fileName)
  3. save(String s, File file)
  4. saveChiPhiTableCsv(PrintWriter wr, double[][] coefficients, String[] labelNames)
  5. saveConvert(final String text, final int escapeMode, final PrintWriter writer)
  6. saveFile(File f, String text)