Since you are passing the key and value pair for the insertion you can store both in the table.
Implement the HashTable using array of Linked list. In each node of the LinkedList store the (key, value) pair as a single object. You will be hashing the key and store (key, value) pair object in the hashvalue location. The object can be like the below one,
public static class WrapObject
{
K key;
V value;
public WrapObject(K key, V value) {
this.key = key;
this.value = value;
}
}
And in get(K key) method , hash the key and iterate through all the (key, value) pair objects in the hashvalue location then return the value for the key.
The following code snippet shows how to do it,
LinkedList<WrapObject>[] arrList = new LinkedList[10001];
public V get(K key)
{
int hashValue=hash(key);
if(arrList[hashValue]==null)
{
return null;
}
LinkedList<WrapObject> lList = arrList[ hashValue ];
for(WrapObject obj : lList)
{
if((obj.key).compareTo(key)==0)
{
return obj.value;
}
}
return null;
}