JSON Object
JSON (JavaScript Object Notation) is a lightweight computer data interchange format. It is a text-based, human-readable format for representing simple data structures and associative arrays (called objects).
The JSON format is often used for transmitting structured data over a network connection in a process called serialization. Its main application is in AJAX web application programming, where it serves as an alternative to the traditional use of the XML format.
Supported Data types are (String, Number, Boolean,Array,
Object(Collection of key/value Pairs),null).
Example
import net.sf.json.JSONObject; public class MyJSON { public static void main(String args[]){ JSONObject object=new JSONObject(); object.put("name","your Name"); object.put("Max.Marks",new Integer(100)); object.put("Min.Marks",new Double(35)); object.put("Scored",new Double(86.67)); object.put("nickname","your"); System.out.println(object); } }
Comments
Post a Comment