4 ms·
Java has generics too. Yeah, unfortunately they're implemented via type erasure, unlike in C#, where they're actually part of the type system (for example, sin
by pmjordan 16y ago
Java has generics too.
Yeah, unfortunately they're implemented via type erasure, unlike in C#, where they're actually part of the type system (for example, since C# 4.0 generics can be covariant and/or contravariant on the type parameters).
- InclinedPlane 16y agoYeah, Java doesn't really have generics. Java has syntactic sugar which provides a good portion of the benefit of generics. But type erasure is not the same thing as generics.
- pmjordan 16y agoIndeed. Unfortunately, that didn't stop them from calling them generics. This choice also pretty much blew the chance of properly integrating true generics into the type system later for backwards compatibility reasons. Well, there's always Scala I suppose.