Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//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];
    }
}