I have a small problem in java while using generics. I have a class A :
public class A<T>
In a method of A, I need to get the type name of T. Is there a way to find the string s using T ?
(If I create A<String> temp = new A<String>();
, I want to be able to get java.lang.String at one point - I have to use generics because one of my methods will have to return a List).
This seems quite easy but I do not see how to do it.
Thanks a lot in advance for your help.