generics - Why doesn't Java allow overloads based on type parameters? -
we can away in .net:
interface i<a> {} interface i<a, b> {}
... in java, same code result in compilation error.
that's interesting, given if type information gone @ runtime, 1 expect information number of type parameter still there.
if limitation related type erasure, can explain why?
it's not related type erasure ambiguity arise using raw type:
i eye = null; // 'i' it?
raw types allowed in order accommodate code written before generics introduced in jdk 5.0.
Comments
Post a Comment