take the following code:
public class Main {
public static void main(String[] args) {
List<Object> list1 = new ArrayList<Object>();
List<? super Integer> list2 = list1;
list2.add(1);
list1.add("two");
//list2.add("three"); // will never compile!!.
System.out.println("list1: " + list1.toString());
System.out.println("list2: " + list2.toString());
}
}
here is the output:
list1: [1, two]
list2: [1, two]
on the one hand, list2 doesn't allow the add() method on objects like the String "three"; but on the other hand it references a List containing Objects.