Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

write json string to file in java

// 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();
}
Source by howtodoinjava.com #
 
PREVIOUS NEXT
Tagged: #write #json #string #file #java
ADD COMMENT
Topic
Name
3+5 =