A
Amarnath B S
Could anyone help me by explaining the behaviour below?
----------code snippet start-----------
static <T> void some( T a[], Collection<T> c){
//nothing
}
.....
some(new Number[100], new ArrayList<Float>()); //compile time error
some(new Float[100], new ArrayList<Number>());//allowed
-----------code snippet end-------------
Why is the first method invocation not allowed? How does the compiler
compare the type dependencies?
thanks in advance,
Amarnath
----------code snippet start-----------
static <T> void some( T a[], Collection<T> c){
//nothing
}
.....
some(new Number[100], new ArrayList<Float>()); //compile time error
some(new Float[100], new ArrayList<Number>());//allowed
-----------code snippet end-------------
Why is the first method invocation not allowed? How does the compiler
compare the type dependencies?
thanks in advance,
Amarnath