How to Convert JSON to Map Object in Java

Convert JSON to Map Object in Java

In this example program, you will learn simple program about, How to Convert JSON to Map Object in Java. The step by step flow of the program are attached below.

Project Structure

How to Convert JSON to Map Object in Java

Input JSON File (data.json)

Converting JSON to Map Object (ConvertJSONToMap.java)

Output

{1=One, 2=Two, 3=Three, 4=Four, 5=Five,
6=Six, 7=Seven, 8=Eight, 9=Nine, 10=Ten}

References

1. Java File Class
2. Java FileReader Class
3. Java GSON Class