import org.json.JSONObject; String jsonString = "{ \"name\": \"John\", \"age\": 30, \"city\": \"New York\" }"; JSONObject json = new JSONObject(jsonString); import org.json.JSONObject; JSONObject json = new JSONObject(); json.put("name", "John"); json.put("age", 30); json.put("city", "New York"); json.put("city", "London"); import org.json.JSONObject; JSONObject json = new JSONObject("{ \"name\": \"John\", \"age\": 30, \"city\": \"New York\" }"); String name = json.getString("name"); int age = json.getInt("age"); String city = json.getString("city"); import org.json.JSONObject; JSONObject json = new JSONObject(); json.put("name", "John"); json.put("age", 30); json.put("city", "New York"); String jsonString = json.toString();


上一篇:
下一篇:
切换中文