JSONObject是用{}表示;

JSONArray是用[]表示,相当于[{ }, { }],是由JSONObject的集合。

 

定义一个String类型

JSONObject jsonOject =new JSONObject(String str);

JSONArray jsonArray = new JSONArray(String str);

 

从JSONArray获取JSONObject值

  JSONObject jsonObject = jsonArray.getJSONObject(i);

  JSONObject   jsonObject = (JSONObject)jsonArray.get(i);

 

相关文章:

  • 2022-02-18
  • 2022-12-23
  • 2021-12-02
  • 2021-06-24
  • 2021-09-28
  • 2021-08-29
  • 2022-01-24
  • 2021-12-26
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-06
  • 2022-12-23
  • 2021-06-21
相关资源
相似解决方案