how does the method infer the type of

前端 未结 2 1329
梦毁少年i
梦毁少年i 2021-01-02 06:17

The below method works flawlessly

public  void fromJsonArray(String jsonString,Type tToken) {
  Gson g = new Gson();
  T list = g.fromJson(jsonStrin         


        
2条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-02 06:46

    T list = g.fromJson(jsonString,tToken);
    

    It's inferred from the return type of g.fromJson().

提交回复
热议问题