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