Because when you have (first example) a List <? super Integer> al = new ArrayList<Number>();
Then the list "al" contains only numbers. This is type safe, you can only add Integers to this list, and what you get out of the list are always Objects. And because you can say Object o = new Integer(3); this should work.
By the way: List <? super Integer> al2 = new ArrayList<Object>(); would work just the same.
But when you have (second example) List <? extends Number> al = new ArrayList<Integer>();
You may think in the first place that add(3);
would be fine, but what you add to this list would always be of type Number, so you also could try to add(3.0);
And further you also can rereference "al" to another List: al = new ArrayList<Double>(); this is allowed, and therefore it is not allowed to add anything (except null) to this kinds of lists.
all events occur in real time
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com