-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Home
Sean Leary edited this page Dec 9, 2018
·
13 revisions
JSON-Java is a reference application for reading and writing JSON docs in Java. It was written by Douglas Crockford, who first specified the JSON document format. It works by parsing and storing JSON text inside of POJOs - Plain Old Java Objects. This allows your Java code to navigate into the doc, read, update, and write the JSON document.
These are the primary classes, which you will interact with the most:
-
JSONObject: Stores JSON objects, which are enclosed in curly braces. A simple JSON object looks something like this:
{ "hello" : "world" }
The easiest way to convert
-
JSONArray: Stores JSON arrays, which are enclosed in square brackets. A simple JSON array looks something like this:
[ "hello", "world" ]