Why for each loop is not applicable for JSON array

后端 未结 3 1743
滥情空心
滥情空心 2021-01-19 10:17

When I was trying to parse a json array, the studio gave me a compilation error stating foreach is not applicable for json array. Although

3条回答
  •  鱼传尺愫
    2021-01-19 11:04

    Because JSONArray derives from Object and foreach expects the collection to be iterable.

提交回复
热议问题