public class HashEntry implements Entry { private K key; private V value; /** Constructor */ HashEntry( K k, V v) { key = k; value = v; } /** Returns the key stored in this entry. */ public K getKey() { return key; } /** Returns the value stored in this entry. */ public V getValue() { return value; } public V setValue(V val) { V oldValue = value; value = val; // Update value return oldValue; // Return old value } public String toString() { return "(" + key + "," + value + ")"; } }