开发者

Create a file based on conditions

How to write a program in Java t开发者_JAVA技巧o check the existence of a txt file if does not exist than create a new one else append the new txt in that file.


FileWriter fstream = new FileWriter("foo.txt",true);
BufferedWriter out = new BufferedWriter(fstream);
out.write("foo bar");
out.close();

The second argumnet to FileWriter tells it to append.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜