Quantcast
Channel: Java Example » json
Viewing all articles
Browse latest Browse all 2

Java – JSON Object Example

$
0
0

JSON Object Example in Java

This example will give JSON Object in java

import net.sf.json.JSONObject;
public class JSONExampleJava {

	/**
	 * JSON Object Example
	 * JSON JavaScript Object Notation lightweight data-interchange format
	 * Alternative to XML format
	 * Easy to use 
	 */
	public static void main(String[] args) {

		 JSONObject json=new JSONObject();
		 json.put("id","111");
		 json.put("name","JSON Example");
		 json.put("value","JSON Object");
		 System.out.println(json);

	}
}

Output JSON Object


{“id”:”111″,”name”:”JSON Example”,”value”:”JSON Object”}

The post Java – JSON Object Example appeared first on Java Example.


Viewing all articles
Browse latest Browse all 2

Trending Articles