I have a list of an ArrayList:
public class Ex{
public static void main(String[] args){
List<Object> list = new ArrayList<>();
list.add(1L);
list.add("hello");
List<?> list1 = new ArrayList<>();
list1.add(1L);
list1.add("hello");
}
}
Why I can't add 1L , and "hello" String to the unbound wildcard ?