I can't see why size(test); won't compile. Can someone help me understand?
public class TestContainer<T extends Object> {
}
.
public class Main {
public static int size(List<TestContainer<?>> list) {
return list.size();
}
public static void main(String[] args) {
List<TestContainer<Object>> test = new ArrayList<TestContainer<Object>>();
size(test); // this does not compile
test.size(); // of course this works fine
}
}