Java Generics and Collections by Maurice Naftalin and Philip Wadler seems to be a very fine introduction to Java generics with emphasis on the Collection classes.
One of the things I never really got about generics is the correct use of super wildcards. While I found extends wildcards to be rather easy to grasp, super wildcards always managed to confuse me. In chapter 2, I found the first definition I immediately understood:
The Get and Put Principle. Use an
extendswildcard when you only get values out of a structure, use asuperwildcard when you only put values into a structure, and don’t use a wildcard when you both get and put.
Combined with the trivial Collection-based example given in the book I find this definition very helpful and easy to remember.
The final draft is was available for free.


