提示
Java IO FileWriter 使用示例。@ermo
public static void write() throws IOException {
String data = "Some text.";
String filepath = "src/main/resources/file-writer.txt";
FileWriter writer = new FileWriter(filepath);
try {
writer.write(data);
writer.flush();
} finally {
writer.close();
}
}
public static void main(String[] args) throws IOException {
write();
}