next up previous index
Next: Other enhancements Up: Generic types Previous: New approach   Index

Multiple type parameters

There can be more than one type parameter for a given class or interface. The code
public interface LookupTable<K,V> {
    public void add(K key, V value);
    public V lookup(K key);
    ...
}
should be self-explanatory. K designates the generic type for the key of the LookupTable, and V designates the generic type for the value.



Peter Williams 2005-06-07