Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

converting array JSON to list

String userJson = "[{'name': 'Alex','id': 1}, "
				+ "{'name': 'Brian','id':2}, "
				+ "{'name': 'Charles','id': 3}]";

Gson gson = new Gson(); 

User[] userArray = gson.fromJson(userJson, User[].class);  

for(User user : userArray) {
	System.out.println(user);
}
Source by howtodoinjava.com #
 
PREVIOUS NEXT
Tagged: #converting #array #JSON #list
ADD COMMENT
Topic
Name
9+9 =