I have a simple generic function
static <T, V extends T> boolean isIn(T x, V[] y) {
for (int i = 0; i < y.length; i++)
if (x.equals(y[i]))
return true;
return false;
}
and I am callling this funciton with following paramters
Integer nums[] = { 1, 2, 3, 4, 5 };
isIn("abc",nums);
Shouldn't the above code have compile time error as T is upper bound to V. But it compiles without errors