Posts

Showing posts from October, 2018

Reading Writing JSON File in JAVA

JSON.simple  is lightweight  JSON processing library  which can be used to read JSON, write JSON file. Produced JSON will be in full compliance with JSON specification ( RFC4627 ). In this  JSON tutorial , we will see quick examples to  write JSON file  with JSON.simple and then we will  read JSON file  back. Json.simple maven dependency Update  pom.xml  with  json-simple  maven dependency. [ Link ] < dependency >      < groupId >com.googlecode.json-simple</ groupId >      < artifactId >json-simple</ artifactId >      < version >1.1.1</ version > </ dependency > 2. Write JSON to file in Java with json-simple To  write JSON to file , we will be working to mainly two objects: JSONArray  : To write data in json arrays. Use its  add()  method to add objects of type  ...