4 ms·
>> Java and C# both added generic types at roughly the same time Really? I thought Java added generics a year after it was added in C# or am I wrong?
by jister 16y ago
>> Java and C# both added generic types at roughly the same time
Really? I thought Java added generics a year after it was added in C# or am I wrong?
- bfung 16y agoother way around, Generics came in java 1.5 and c# 2.0: http://en.wikipedia.org/wiki/Java_version_history#J2SE_5.0_.28September_30.2C_2004.29 http://en.wikipedia.org/wiki/Java_version_history#J2SE_5.0_.... http://en.wikipedia.org/wiki/C_Sharp_(programming_language)#Versions http://en.wikipedia.org/wiki/C_Sharp_(programming_language)#... but that's only from a programmer standpoint, and matters very, very little. The bytecode level is where the real difference comes. Sun hacked generics into the java compiler so it loses the type information (type erasure) in the byte code. By rumor, the CLR vm/bytecode was also designed by roughly the same group of people, lured away from sun by microsoft. the CLR keeps the type information around so it allows some more reflection magic to be implemented.
- deleted 16y ago[deleted]