PDA

View Full Version : java reflection



mickey
24th July 2008, 16:29
could anyone explain me the sense of the
"Comparing C# and Java Generics", Anders Hejlsberg reply at paragraph 3 ("Issue number two, and.......) ?
http://www.artima.com/intv/generics2.html
I don't understand the sense of what he says about reflection in java (is it possibile or not?)

thanks,

caduel
24th July 2008, 21:17
Reflection is possible.
It's just that the reflection can tell you (for generic lists) only that the list is a list of Object. Even if the list 'really' (but only in your source!) is a list of String, int or anything else.
In other words: reflection on generics does not give you information on the generic type used. For non-generic stuff reflection works as it should.

HTH