Self Check
- The standard library provides a class HashMap<K, V>
with key type K and value
type V. Declare a hash map that maps strings to integers.
- The binary search tree class in Chapter 21 is an example of
generic programming
because you can use it with any classes that implement the Comparable
interface. Does it achieve genericity through inheritance or type
variables?