Can I know the concrete type of a generics
List<Integer> aList;I need to know whether a variable is declared as a list of Integer.But I can not use instanceof:aVariable instanceof List<Integer>Is there a way(API) to know the concrete type "Integer"? Thanks,Dave
[279 byte] By [
javatena] at [2007-10-2 5:40:02]

You can't know it at run time because the compiler "erases" the information as part of creating the class file. As far as the JVM is concerned, it's just a List.Why do you "need" this information? Maybe there is another way to do what you want.