/**
* 写出文件
* @author Administrator
*
*/
public class demo2 {
public static void main(String[] args) {
//创建源
File dest=new File("E:/others/goodOrBad11.txt");
Writer wr=null;
try {
wr=new FileWriter(dest,true);//追加覆盖
//写出
String msg="加油少年!";
wr.write(msg);
wr.flush();
} catch (IOException e) {
e.printStackTrace();
}finally {
try {
if (null != wr) {
wr.close();
}
} catch (Exception e2) {
}
}
}
}
[IO]——纯文本写出
最新推荐文章于 2020-10-10 16:29:55 发布