java创建文件并写文件

String path = "H:/data.txt";
File file = new File(path);
FileWriter fw = new FileWriter(path);
fw.write("要写入的数据");
fw.close();


你可能感兴趣的:(java)