How can I achieve this?
public class GenericClass { public Type getMyType() { //How do I return the type of T? } }
I did the same as @Moesio Above but in Kotlin it could be done this way:
class A() { var someClassType : T init(){ this.someClassType = (javaClass.genericSuperclass as ParameterizedType).actualTypeArguments[0] as Class } }