JSON | JavaScript Object Notation
JSON
- JSON Stands for JavaScript Object Notation.
- JSON is used for exchanging and storing data.
- JSON is an easier to use alternative to XML.
- JSON is a lightweight data-interchange format.
- JSON is language independent.
- JSON is “self-describing” and easy to understand.
JSON example defines Students object with an array of three students:
{"students":[
{"FirstName":"ravi", "Lastname":"srivastva"},
{"FirstName":"Anju", "LastName":"Anju"},
{"FirstName":"Sanjeev", "LastName":"rai"}
]}
JSON Objects
Inside curly braces write json objects like:
JSON Array
Json array must be written inside square braces.
like:
like:
The following XML example also defines Students object with 3 students records:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
<students>
<student>
<FirstName>ravi</FirstName>
<LastName>srivastva</LastName>
</student>
<student>
<FirstName>Anju</FirstName>
<LastName>Anju</LastName>
</student>
<student>
<FirstName>Sanjeev</FirstName>
<LastName>rai</LastName>
</student>
</students>
|
Comments
Post a Comment