當前位置:成語大全網 - 書法字典 - 字典的數組屬性

字典的數組屬性

HashMap & ltString,String & gtmap = new HashMap & ltString,String & gt();

string jsonStr =“【{ \“key \“:\“1 \“},{ \“key 1 \“:\“2 \“}】“;

JSON array JSON arr = JSON array . from object(JSON str);

for(int I = 0;我& ltJSON arr . size();i++){

JSON object obj = JSON object . from object(JSON arr . get(I));

叠代器it = obj . keys();

while(it . hasnext()){

string key = string . value of(it . next());

字符串值=(String)obj . get(key);

map.put(鍵,值);

}

}

system . out . println(map);