Creating JSON data in Java

Submitted by:Jhon Brain

Date added:06 June, 2013

Category:Java

Example shows here how to create JSON data in Java

Tags: json data

Code Snippet:

import org.json.JSONObject;
...
...
JSONObject json = new JSONObject();
json.put("city", "Mumbai");
json.put("country", "India");
...
String output = json.toString();
...
 
 

Comments