• June 17, 2015
  • JSON
  • Comments Off on JSON format and data types

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:

    {"firstName":"Sandy", "lastName":"Sethi"},
    {"firstName":"Roxy", "lastName":"Malik"},
    {"firstName":"Sunil", "lastName":"Antil"}

JSON datatypes:

Data Type Description
  1. Number
It represents double-precision floating-point format in JavaScript
  1. String
It represents double-quoted Unicode with backslash escaping
  1. Boolean
It represents true or false
  1. Array
It represents an ordered sequence of values
  1. Value
it can be a string, a number, true or false, null etc
  1. Object
It represents an unordered collection of key:value pairs
  1. Whitespace
It can be used between any pair of tokens
  1. null
It represents empty

Next Topic: How to create json object from string in javascript?
Previous Topic: JSON overview.

Related Topics:

How to build java project using ant in eclipse?
JAXB marshalling – convert java object to xml example.
How to create pdf file in java using iText jar?
Generics class example.
OGNL in struts 2.
Hibernate One-to-One Mapping using xml.
Send inline image in email using JavaMail API.
Quartz 2 JobListener example.


Comments are closed.