用JAVA编写一个程序,如果test.TXT不存在,以该名创建一个文件,如果该文件已存在,向其中添加数据?public void a#28#29 { try { File f = new File#28#30"D:#30
用JAVA编写一个程序,如果test.TXT不存在,以该名创建一个文件,如果该文件已存在,向其中添加数据?
public void a#28#29 { try { File f = new File#28#30"D:#30#301.txt#30"#29 if #28#21f.exists#28#29#29 { f.createNewFile#28#29 } FileWriter fw = new FileWriter#28f#29 PrintWriter pw = new PrintWriter#28fw#29 Random random = new Random#28#29 for#28int i=0i本文链接:http://21taiyang.com/Open-SourceComputers/2328785.html
java创建《jiàn》文件夹并写入文件转载请注明出处来源