I am having a converting that in to Json with following code
JSONObject jsonformatted = (JSONObject)JSONSerializer.toJSON(map);
FileWriter writer = new FileWriter("myfile.json");
It is working fine and out put is following
[ {"date":"July 4th", "event":"Independence Day"} ]
But I want the following format with a variable assign get value in Json
jsonstr = [ {"date":"July 4th", "event":"Independence Day"} ];
How can i add a variable to that