FileWriter的使用及其方法
write常用的几种形式:
@Test
public void filewriter()throws IOException{
String path = "D:\\njust.txt";
FileWriter fw = new FileWriter(path);
fw.write("zjc0"+"\n");
fw.write("zjc1"+"\n");
fw.write("zjc2"+"\n");
fw.write("zjc3"+"\n");
fw.write("zjc4"+"\n");
fw.write("zjc5"+"\n");
fw.close();
}
版权声明:本文为NJUSTZJC原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。