Java JSON Tutorial - JSON Syntax

JSON syntax can be summarized as follows:

  • Data is represented in name/value pairs.
  • Curly braces hold objects, the name/value pairs are separated by ,.
  • Square brackets hold arrays and values are separated by ,.

JSON supports the following two data structures:

Data structureDescription
Collection of name/value pairskey:value,key:value,
Ordered list of values[1,2,3,4]


The following JSON data specifies books.

    "book": [
       "language": "Java",
       "edition": "third",
       "author": ""
       "language": "JSON",
       "edition": "second"
       "author": ""