How can I achieve this?
public class GenericClass { public Type getMyType() { //How do I return the type of T? } }
It might be useful to someone. You can Use java.lang.ref.WeakReference; this way:
class SomeClass{ WeakReference variableToGetTypeFrom; N getType(){ return variableToGetTypeFrom.get(); } }