2021
01-17
01-17
Java 如何遍历JsonObject对象
方法:Iteratoriter=jsonInfo.entrySet().iterator();代码示例:publicclassTest{publicstaticvoidmain(String[]args){JSONObjectjsonInfo=newJSONObject();Stringkey1="a";jsonInfo.put(key1,"aa");Stringkey2="b";jsonInfo.put(key2,"bb");Iteratoriter=jsonInfo.entrySet().iterator();while(iter.hasNext()){Map.Entryentry=(Map.Entry)iter.nex...
继续阅读 >