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

Popular posts from this blog

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

how can i manage url using .htaccess in php? -

ios - I get the error Property '...' not found on object of type '...' -