json数据转为Map集合

2023-06-13,,

我是利用Gson来弄得
Gson gson = new Gson();
//显得出HashMap的类型
Type type = new TypeToken<HashMap<String, String>>(){
}.getType();
//转为map集合
Map<String,String> map = gson.fromJson(body,type);

json数据转为Map集合的相关教程结束。

《json数据转为Map集合.doc》

下载本文的Word格式文档,以方便收藏与打印。