JSON-Syntax
What is JSON? JSON_Syntax JSON_Data Types JSON_vs_XML JSON_Array JSON_Object
- JSON follows a specific syntax.
- JSON data consists of two parts that are key and value simply called key/value pair.
- The key/value pair can be written as a key followed by a colon and followed by a value in which both key and value are enclosed with double quotation marks.
- Each data is separated by a comma.
- Square brackets used to hold array.
- Curly braces used to hold objects
Syntax:
"Key": "value"
Simple Example:
JSON object:
{
"Student": { "name":" Arun "," Dept ":" CSE "," Grade " : "A"}
}
JSON Array
{
"Student":["Arun"," CSE ","A "]
}
<<Previous - JSON Introduction