您的位置:首页 > 其它

[IO]——纯文本写出

2016-04-07 19:48 363 查看
/**
* 写出文件
* @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 纯文本写出