org.json
Stay organized with collections
Save and categorize content based on your preferences.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-10 UTC."],[[["\u003cp\u003eThe Java JSON library provides classes for working with JSON objects, arrays, strings, and tokens.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eJSONArray\u003c/code\u003e represents an ordered list of values, while \u003ccode\u003eJSONObject\u003c/code\u003e stores unordered key-value pairs.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eJSONStringer\u003c/code\u003e helps with creating JSON text, and \u003ccode\u003eJSONTokener\u003c/code\u003e is used for parsing JSON data from a string.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eJSONException\u003c/code\u003e is the primary exception thrown when encountering JSON-related errors.\u003c/p\u003e\n"]]],["The provided content describes key classes and an exception related to a JSON API. `JSONArray` is a sequence of values. `JSONObject` is a modifiable set of mappings. `JSONStringer` implements the `toString()` methods for the previous two. `JSONTokener` parses JSON strings into objects. `JSONException` is thrown when problems with the JSON API are encountered.\n"],null,["Classes \n\n|---------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [JSONArray](../../../reference/org/json/JSONArray.html) | A dense indexed sequence of values. |\n| [JSONObject](../../../reference/org/json/JSONObject.html) | A modifiable set of name/value mappings. |\n| [JSONStringer](../../../reference/org/json/JSONStringer.html) | Implements [JSONObject.toString()](../../../reference/org/json/JSONObject.html#toString()) and [JSONArray.toString()](../../../reference/org/json/JSONArray.html#toString()). |\n| [JSONTokener](../../../reference/org/json/JSONTokener.html) | Parses a JSON ([RFC 4627](http://www.ietf.org/rfc/rfc4627.txt)) encoded string into the corresponding object. |\n\nExceptions \n\n|-----------------------------------------------------------------|-------------------------------------------------|\n| [JSONException](../../../reference/org/json/JSONException.html) | Thrown to indicate a problem with the JSON API. |"]]