我怎样才能做到这一点?
public class GenericClass<T> { public Type getMyType() { //How do I return the type of T? } }
到目前为止我尝试的所有东西总是返回类型Object而不是使用的特定类型.
Object
java generics reflection
generics ×1
java ×1
reflection ×1