This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
Currently, you have two lists:
1) myList1 - this contains objects of A or its subtype.
2) myList2 - this contains objects of A or its supertype.
Now, the problem is - A can have many subtypes (e.g. X extends A, Y extends A and so on), and hence, myList1 can be a terrible mess of all subtypes of A. To avoid this, Java does not simply allow to add any element to this list.
However, in myList2, all the objects are going to be objects of A (or its supertype) - and hence, myList2 will not be a mess of different objects (that is - objects would be from same hierarchy), and hence, Java allows adding elements in myList2.
So, what's the use of myList1?
Well, you can have a method which accepts a List<? extends A>, and further, while invoking that method, you can pass List<A>, List<B> or List<C> (provided you don't add any element to that list inside the method).