且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在Java中将hashmap转换为JSON对象

更新时间:2022-11-18 23:09:55

你可以使用:

new JSONObject(map);

警告:这只适用于 Map< String,String>!

您可以从其文档中获取的其他函数

http://stleary.github.io/JSON-java/index.html

Other functions you can get from its documentation
http://stleary.github.io/JSON-java/index.html