learning java FileWriter

import java.io.FileWriter;
import java.io.IOException;

public class FileWriterTest {
    public static void main(String[] args) {
        try {
            var fw = new FileWriter("pop.txt");
            {
                fw.write("11111\r\n");
                fw.write("11111\r\n");
                fw.write("11111\r\n");
                fw.write("11111\r\n");
                fw.write("11111\r\n");
            }
            fw.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

 

posted @ 2019-08-05 13:13  嵌入式实操  阅读(80)  评论(0编辑  收藏  举报