June 2004
Intermediate to advanced
848 pages
21h 28m
English
The final piece of generics relates to the interaction between generic type parameters and methods. Most of the generic features we have seen so far are intended for API and library programmers. The main thing regular programmers need to remember is that:
public class HashSet <E> { /*more code*/
means that (to use this class) you will declare and instantiate a HashSet to work with a specific type:
HashSet<Timestamp> ht = new HashSet<Timestamp>();
The generic features presented in this section are different. These features are intended for use by regular programmers. You'll need these features in your own code, when you use somebody else's generic class.
There are two main generic-related features ...
Read now
Unlock full access