Loading
Generate JSON Java

Java Quick Notes

Refresh Your Java - Before Java Interview

We are Agile, believe in less Documentation - Only Quick notes (Java Interview Questions) of Java/J2ee Read more....


Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet

Go to SiteMap

Q)  How to generate JSON by using Java ?


Ans)

You have to use "JSONObject" API. Please take a look at the following Example.

import net.sf.json.JSONObject;

public class YourJSONJavaExample
{
  public static void main(String args[]){
  JSONObject object=new JSONObject();
 object.put("firstname","John");
 object.put("age",new Integer(21));
 object.put("lastname","smith");
 System.out.println(object);
  }



Back to top

------------------------- We hope you got necessary Info On -----------------------------------------

Generate JSON Java


Generate JSON Java

-------------------------------------------------------------------------------------------------------



Face Book
Request for a Mock Interview/Training

Get a PDF

Face Book
Same look (Read) on any device, this is Ads free