When it comes to classes without generics, I can access this .class attribute as follows:
class Foo{ Class<Foo> getMyClass(){ return Foo.class; } }
but how do I access this ".class" attribute if Foo has it in common? eg:
class Foo<T>{ Class<Foo<T>> getMyClass(){ return (Foo<T>).class //this doesnt work... } }
I tried to return Foo.class , but this will not work: "cannot cast from Class<Foo> to Class<Foo<T>>" .
How can I access the Foo<T> class?
source share