Java tutorial
//package com.java2s; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; public class Main { public static <T> Class<T> getTClass(Class<T> c) { Type genType = c.getGenericSuperclass(); return (Class<T>) ((ParameterizedType) genType).getActualTypeArguments()[0]; } }