title: How to add a new line between each JSONObject in a JSONArray, using json.simple and java
body: <p>I am trying to write to a json file using a JSONArray object from the json.simple library. The problem that I am having is that the format of the file comes out like this: </p>
  
  <pre><code>[{"artist_name":"test1","year":0,"album_name":null,"song_name":"test1"},{"artist_name":"test1","year":0,"album_name":null,"song_name":"test1"}]
  </code></pre>
  
  <p>when I would like the format to come out like this:</p>
  
  <pre><code>[{"artist_name":"test1",
  "year":0,
  "album_name":null,
  "song_name":"test1"},
  
  {"artist_name":"test1",
  "year":0,
  "album_name":null,
  "song_name":"test1"}]
  </code></pre>
  
  <p>this is what my code looks like right now:</p>
  
  <pre><code>        FileWriter filewriter = new FileWriter("filesystem.json");
  
          JSONObject newo = new JSONObject();
          newo.put("song_name", "test1");
          newo.put("artist_name", "test1");
          newo.put("album_name", null);
          newo.put("year", 0);
  
          arr.add(newo);
          filewriter.write(arr.toJSONString());
          filewriter.flush();
          filewriter.close();
  </code></pre>