JSON array get length

后端 未结 7 1119
长情又很酷
长情又很酷 2021-01-17 08:25

I can\'t get the array length of the JSON array. when I using length(); method it is not working, it show as red underline in Netbeans

this is the source code

7条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-17 08:49

    Note: if you're using(importing) org.json.simple.JSONArray, you have to use JSONArray.size() to get the data you want. But use JSONArray.length() if you're using org.json.JSONArray.

提交回复
热议问题