skip to main | skip to sidebar

Java Programs and Examples with Output

Pages

▼
 
  • RSS
  • Twitter
Sunday, October 21, 2012

Creating JSON using Java

Posted by Raju Gupta at 9:30 PM – 0 comments
 
This is used to create JSON objects using Java

import org.json.JSONObject;
//Creating JSON object
JSONObject json = new JSONObject();
//Put tag name and value to the object
json.put("city", "Mumbai");
json.put("country", "India");

String output = json.toString();

Labels: Java JSON Example

Leave a Reply

Newer Post Older Post
Subscribe to: Post Comments ( Atom )
  • Popular
  • Recent
  • Archives
Powered by Blogger.
 
 
 
© 2011 Java Programs and Examples with Output | Designs by Web2feel & Fab Themes

Bloggerized by DheTemplate.com - Main Blogger