Convert a JSON String to a HashMap

I’m using Java, and I have a String which is JSON:

{
"name" : "abc" ,
"email id " : ["[email protected]","[email protected]","[email protected]"]
}

Then my Map in Java:

Map<String, Object> retMap = new HashMap<String, Object>();

I want to store all the data from the JSONObject in that HashMap.

Can anyone provide code for this? I want to use the org.json library.

19 Answers
19

Leave a Comment