File file = new File("E:\\demo.txt"); FileWriter out = new FileWriter(file); out.write("Hello World"); out.close(); 创建文件并写入数据