Switch to Bing in English
About 110,000 results
Open links in new tab
  1. JSONObject is a class in Java that represents an immutable JSON object value, which is an unordered collection of zero or more name/value pairs. It provides a map-like structure to store and manipulate JSON data. This class is part of the javax.json package and can be used to create, read, and write JSON objects.

    Creating a JSONObject

    You can create a JSONObject in several ways:

    1. From an Input Source: JsonReader jsonReader = Json.createReader(...); JsonObject object = jsonReader.readObject(); jsonReader.close();

    2. Using a JsonObjectBuilder: JsonObject object = Json.createObjectBuilder().build();

    3. From a JSON String: JSONObject jo = new JSONObject("{\"city\":\"chicago\",\"name\":\"jon doe\",\"age\":\"22\"}");

    4. From a Map: Map<String, String> map = new HashMap<>(); map.put("name", "jon doe"); map.put("age", "22"); map.put("city", "chicago"); JSONObject jo = new JSONObject(map);

    Adding Data to JSONObject

    You can add data to a JSONObject using the put method:

    Feedback
  2. JsonObject (Java (TM) EE 7 Specification APIs) - Oracle

    Jun 1, 2015 · Learn how to create, access and write JsonObject values, which are immutable JSON objects with name/value pairs. See examples, methods and nested classes of JsonObject interface.

  3. Java標準に最も近い?org.jsonライブラリ徹底解説 – 基本から応用 ...

    Jul 13, 2025 · JSONObjectの生成と値の追加 (put) JSONObject のインスタンスを生成し、 put() メソッドを使ってキーと値を追加します。 値には文字列、数値、真偽値、 null 、さらには別の …

  4. JSONObject (JSON in Java 20250517 API)

    A JSONObject is an unordered collection of name/value pairs. Its external form is a string wrapped in curly braces with colons between the names and values, and commas between the values and names.

  5. People also ask
  6. Java中的JSONObject详解 - CSDN博客

    Nov 26, 2024 · JSONObject 是Java中处理JSON数据的强大工具,它不仅支持基本的创建和数据操作,还提供了遍历、与 JSONArray 的结合使用以及错误处理等高级特性。

  7. JsonObject (Jakarta EE 8 Specification API) - Javadoc

    Sep 3, 2019 · JsonObject は、不変の JSON オブジェクト値を表すインターフェースで、JsonReader や JsonObjectBuilder を使って作成できます。JsonObject には、名前と値のペアのマップビューと、JsonValue のサブクラスを含むメソッドがあります。

  8. Getting a Value in JSONObject - Baeldung

    May 5, 2025 · Learn how to use the getter methods and the recursive approach to fetch values from JSONObject instances in Java. See examples of JSON data, code snippets, and test cases.

  9. JSONObject とは何か、そしてどのように使うのか - Blog ...

    Mar 26, 2024 · JSONObjectはJavaにおけるJSONオブジェクトを表現するためのクラスです。 JSON(JavaScript Object Notation)は軽量なデータ交換フォーマットで、バックエンドとフロント …

  10. JSON In JavaのJSONObjectのカスタマイズ - Qiita

    Oct 7, 2025 · JSON In JavaのJSONObjectのカスタマイズ Java JSON Last updated at 2025-10-07 Posted at 2025-03-23

  11. arrays - 万引きGメン直伝!JavaでJSON文字列をJSONObject ...

    Jul 18, 2025 · 「JSON文字列をJSONObjectにしたいんだけど、どうも上手くいかない」って顔してるぜ。 任せときな! 俺がビシッと解決してやるよ。 まるで万引きGメンが怪しい動きを見逃さないよ …

  12. Org.Json - JSONObject Class - Online Tutorials Library

    JSONObject class is a unordered collection of key-value pairs. It provides methods to access values by key and to put values. Following types are supported −

By using this site you agree to the use of cookies for analytics, personalized content, and ads.Learn more about third party cookies|Microsoft Privacy Policy