如何获取传递给方法的参数的类型参数?例如我有如何获取泛型方法参数的类型参数类?
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 ;
}
}
downvoter谨慎解释? – 2013-02-19 11:10:05