How to Convert JSON to List in Java

Convert JSON to List in Java

In this example program, we are showing simple program about, How to Convert JSON to List in Java. The example program were tested and attached in the same post.

Project Structure

How to Convert JSON to List in Java

1) Input JSON Data (data.json)

2) Simple POJO Class (Employee.java)

3) Converting JSON to List Object

Output

JSON File Converted to List
————————–
ID : 101
Name : John
Age : 21
Qualification : MS
Salary : 10000.0

ID : 102
Name : James
Age : 22
Qualification : MBA
Salary : 12000.0

ID : 103
Name : William
Age : 24
Qualification : MCA
Salary : 13000.0

ID : 104
Name : Smith
Age : 23
Qualification : Msc
Salary : 12500.0

ID : 105
Name : Alex
Age : 26
Qualification : MTech
Salary : 15000.0

References

1. Java List Interface
2. Java File Class
3. Java FileReader Class
4. Java GSON Class
5. Java fromJSON(..) Method
6. Convert JSON to Object in Java