How can I achieve this?
public class GenericClass { public Type getMyType() { //How do I return the type of T? } }
Here's one way, which I've had to use once or twice:
public abstract class GenericClass{ public abstract Class getMyType(); }
Along with
public class SpecificClass extends GenericClass{ @Override public Class getMyType(){ return String.class; } }