Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次の2つのjsonオブジェクトを連結したいと思います。どうやってやるの?私のjsonオブジェクトは次のとおりです。
"Object1": { "Stringkey":"StringVal", "ArrayKey": [Data0, Data1] } "Object2": { "Stringkey":"StringVal", "Stringkey":"StringVal", "Stringkey":"StringVal", }
JSONObject obj3 = (JSONObject) obj1.get("Object1"); JSONObject obj4 = (JSONObject) obj2.get("Object2"); JSONObject combined = new JSONObject(); combined.put("Object1", obj3); combined.put("Object2", obj4);