[The Java Posse] Re: Fwd: [The Java Posse] Re: episode 215: reflection and generics

2008-11-15 Thread Matt Scully
As an example, take a look at the Runtime Environment section of this comparison of generics implemented in C# compared to Java. Within the generic class there is no way to query for runtime type information in Java like there is in C# due to erasure: http://www.jprl.com/Blog/archive/development

[The Java Posse] Re: Fwd: [The Java Posse] Re: episode 215: reflection and generics

2008-11-12 Thread Tasos Zervos
Marcelo, If instead of GenericTest you replace with e.g. Map what I interpret you are saying is that you can't tell from the (runtime) Map object what type it is meant to be used with. However, the client of such an object *will* know the type, like this: public Map map1 = new HashMap(); Wouldn

[The Java Posse] Re: Fwd: [The Java Posse] Re: episode 215: reflection and generics

2008-11-11 Thread Marcelo Fukushima
actually my point was that you can only get the generic type information in the cases where it is there in compile time but, for instance, imagine that you had this: public class GenericTest { private List list = new ArrayList(); } even if you create an instance of GenericTest with String, t

[The Java Posse] Re: Fwd: [The Java Posse] Re: episode 215: reflection and generics

2008-11-11 Thread Tasos Zervos
Can you please give an example with some bits of code? I'm not sure what scenario you are trying to solve (or implying you can't solve). What are you going to use a Map instance field for? (Would this be a "Generics" way of initialise a field?) On Nov 10, 10:27 pm, "Marcelo Fukushima" <[EMAIL PRO