[Mono-list] How do I reference generic classes in C#???
jonpryor at vt.edu
Fri Jan 9 23:05:36 EST 2009
On Fri, 2009-01-09 at 16:42 -0800, neptune235 wrote:
> Oh, that's totally different than Java, but it seems to work fine. Thanks for
> your help!
That's because Java implements generics through type erasure, so all
generic instantiations use the same (non-generic) type. .NET generics
This confers a number of advantages (and a few disadvantages with
respect to generic co- and contra-variance, which C# 4 fixes); see the
Completely Unbiased* article:
* read: biased, based on my experiences trying to understand Java
generics, then wondering wtf they were thinking...
More information about the Mono-list