I read the following two links for java generics wildcards
Difference between generic type and wildcard type
and
Are wildcard generics really needed?
I still don't understand wildcards as to how this compiles,
public void foo(List<List<?>> t) {
t.add(new ArrayList<String>());
t.add(new ArrayList<Integer>());
}
but this does not,
public static void funct2(final List<?> list, final Object something) {
list.add(something); // does not compile
}
Aren't we doing the same thing in the second code block as the first?