Deserializing Generic Types with GSON
You have to specify the type of T at the time of deserialization. How would your List of posts get created if Gson didn’t know what Type to instantiate? It can’t stay T forever. So, you would provide the type T as a Class parameter. Now assuming, the type of posts was String you would … Read more