如何获取传递给方法的参数的类型参数?例如,我有:
List<Person> list = new ArrayList<Person>();
public class Datastore {
public <T> void insert(List<T> tList) {
// when I pass the previous list to this method I want to get Person.class ;
}
}