Tutorialspoint Examples: JSON Format and Data Types
Tutorialspoint Examples: JSON Format and Data Types
Tutorialspoint examples
(http://tutorialspointexamples.com)
Learn java tutorial with examples for beginners online
Search
JSON Format And Data Types
JSON Syntax:
JSON syntax is a subset of the JavaScript object notation syntax. JSON syntax has following
rules:
1. Data is represented in name/value pairs.
2. Data is separated by commas.
3. Curly braces hold objects and each object name is followed by colon.
4. Square brackets hold arrays.
JSON example:
{"students":[
{"firstName":"Sandy", "lastName":"Sethi"},
{"firstName":"Roxy", "lastName":"Malik"},
{"firstName":"Sunil", "lastName":"Antil"}
]}
JSON datatypes:
Data Type Description
Number It represents doubleprecision floatingpoint format in JavaScript
String It represents doublequoted Unicode with backslash escaping
Boolean It represents true or false
Array It represents an ordered sequence of values
Value it can be a string, a number, true or false, null etc
Object It represents an unordered collection of key:value pairs
Whitespace It can be used between any pair of tokens
http://tutorialspointexamples.com/jsonformatanddatatypes/ 1/5
1/12/2016 JSON format and data types | Tutorialspoint examples
null It represents empty
Next Topic: How to create json object from string in javascript?
(http://tutorialspointexamples.com/howtocreatejsonobjectfromstringinjavascript/)
Previous Topic: JSON overview. (http://tutorialspointexamples.com/jsonoverview/)
Related Topics:
How to build java project using ant in eclipse? (http://tutorialspointexamples.com/howtobuildjava
projectusingantineclipse/)
JAXB marshalling – convert java object to xml example. (http://tutorialspointexamples.com/jaxb
marshallingconvertjavaobjecttoxmlexampleusingonepojo/)
How to create pdf file in java using iText jar? (http://tutorialspointexamples.com/howtocreatepdffile
injavausingitextjar/)
Generics class example. (http://tutorialspointexamples.com/genericsclassexample/)
OGNL in struts 2. (http://tutorialspointexamples.com/ognlinstruts2/)
Hibernate OnetoOne Mapping using xml. (http://tutorialspointexamples.com/hibernateonetoone
mappingusingxml/)
Send inline image in email using JavaMail API. (http://tutorialspointexamples.com/sendinlineimage
inemailusingjavamailapi/)
Quartz 2 JobListener example. (http://tutorialspointexamples.com/quartz2joblistenerexample/)
JSON Tutorial
JSON overview. (http://tutorialspointexamples.com/jsonoverview/)
JSON format and data types (http://tutorialspointexamples.com/jsonformatanddatatypes/)
JSON object from string. (http://tutorialspointexamples.com/howtocreatejsonobjectfromstringin
javascript/)
Access json object array. (http://tutorialspointexamples.com/howtoaccessjsonobjectarrayin
javascript/)
JSON object in java. (http://tutorialspointexamples.com/howtousejsonobjectinjava/)
Parse json in java. (http://tutorialspointexamples.com/howtoparsejsoninjavawithexample/)
Download JSON jar. (http://tutorialspointexamples.com/wpcontent/uploads/2015/06/JSONLib.rar)
http://tutorialspointexamples.com/jsonformatanddatatypes/ 2/5