轉載請標明出處:https:////www.cnblogs.com/tangZH/p/9451473.html
文章鏈接:http://77blogs.com/?p=146
{
"data":{
"shop_uid":"123";
“id”:"123"
}
}
將上面的json字符串轉換為JSONObject之后可能會出現順序不一樣,即在JSONObject中,可能是下面的順序:
“id”:"123"
"shop_uid":"123";
為了保證順序一樣,可以用:
JSONObject jsonObject = JSONObject.parseObject(dataString, Feature.OrderedField);
后面加上參數:
Feature.OrderedField