D
David Portabella
Hello,
Taking this simple code:
+++++++++++++++++++++++++++++++++++
import java.lang.reflect.*;
public class Test<T> extends Class1{
public T data;
public static void main(String[] argv) throws Exception {
Test<String> app = new Test<String>();
Field f = app.getClass().getField("data");
System.out.println("type: " + f.getType());
}
}
+++++++++++++++++++++++++++++++++++
it produces: "type: class java.lang.Object" instead of "type: class
java.lang.String".
why??
how can I get "java.lang.String"?
ps: I've tried with f.getGenericType(), but it returns "T", which is
not useful neither for my purpose.
Regards,
DAvid
Taking this simple code:
+++++++++++++++++++++++++++++++++++
import java.lang.reflect.*;
public class Test<T> extends Class1{
public T data;
public static void main(String[] argv) throws Exception {
Test<String> app = new Test<String>();
Field f = app.getClass().getField("data");
System.out.println("type: " + f.getType());
}
}
+++++++++++++++++++++++++++++++++++
it produces: "type: class java.lang.Object" instead of "type: class
java.lang.String".
why??
how can I get "java.lang.String"?
ps: I've tried with f.getGenericType(), but it returns "T", which is
not useful neither for my purpose.
Regards,
DAvid