📅  最后修改于: 2022-03-11 14:52:40.153000             🧑  作者: Mango
// Write JSON string to a file
try (FileWriter file = new FileWriter("fileName.json")) {
file.write(data); // data is a JSON string here
file.flush();
} catch (IOException e) {
e.printStackTrace();
}