mohan mohan - 1 year ago 188
Java Question

How to convert hashmap to JSON object in Java

How to convert or cast hashmap to JSON object in Java, and again convert JSON object to JSON string?

Answer Source

use

 new JSONObject(map);

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