-4

I know that I can do this:

Class<T> type = (Class<T>) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0];

But how can I create a class based on this new type?

Class<MyObject<T>> type = ???;

thanks

4

1 に答える 1

0
Class<MyObject<T>> type = (Class<MyObject<T>>)(Class<?>)MyObject.class;
于 2013-11-06T23:36:36.880 に答える