以前解析map的时候通常都是
google
Map<String, String> param = new HashMap<String, String>();spa
String signature = JSONObject.fromObject(param).toString();it
可是今天发现这样子解析出来的额 字段顺序跟put的顺序不一致哎map
google以后 看到说用LinkedHashMap 遂试了试 发现果然 顺序同样了 co
Map<String, String> param = new LinkedHashMap<String, String>();asp
String signature = JSONObject.fromObject(param).toString();background
缘由是:HaspMap是无序,LinkedHashMap是有序的new