F
F
fanhypermax2018-11-14 04:10:17
Java
fanhypermax, 2018-11-14 04:10:17

How to do something similar in java?

let Obj = [
         [
        {o:'-12188866'},
        {o:'-175'},
         ],
      
         [
              {g:78554274,t:30718264},
         ] 		
   ];

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evhen, 2018-11-14
@EugeneP2

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.*;

String json = "";

Type listType = new TypeToken<List<List<Map<String, String>>>>(){}.getType();
Gson gson = new GsonBuilder().create();
List<List<Map<String, String>>> list = gson.fromJson(json, listType);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question