How can I achieve this?
public class GenericClass { public Type getMyType() { //How do I return the type of T? } }
You can't. If you add a member variable of type T to the class (you don't even have to initialise it), you could use that to recover the type.