mohan mohan - 7 months ago 113
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

use

 new JSONObject(map);

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