Wednesday, August 12, 2009

I'm surprised that I only recently made this realization: Java arrays are just a special case of a generic class. Of course, since arrays have been part of the JVM from the beginning, they get special treatment -- no type erasure and covariance being major examples. I'm surprised that I didn't make this connection sooner, because, in some other languages, arrays are not conceptually different than other generic types. In Standard ML, for example, 'a array is just another type with a single type parameter.

No comments:

Post a Comment