title: hash table with 2D array
body: <p>I have been asked to create hash table using 2D array. I did it how ever in my put method there is something wrong in my understanding 2D array have to have two loops to do the implementing here is my put code i cannot insert anything. </p>
  
  <pre><code> public class Array2DHashTable&lt;K, V&gt; {
      // here is my variable and my constructor. 
       // Array2DHashTable(int tableSize){ table = (Entry[][]) new HashEntry[tableSize]     [COLUMN_SIZE]; 
      //numItems = 0; }
  
      public void put(K key, V value){
         int hash= key.hashCode() % ROW_SIZE;
          int seenIt = hash;
         int j;
        for(j=0;j&lt;COLUMN_SIZE;j++){
          while(table[hash][j] != null &amp;&amp; table[hash][j].getKey().equals(key)){
            hash= ( hash+1)%ROW_SIZE;
            if(hash == seenIt) return;
            }
         }
        table[hash][j] = new HashEntry(key,value);
        numItems++;
      }
  
  }
  
  
  class HashEntry&lt;K, V&gt;  implements Entry&lt;K, V&gt;  {
  
    // all the variables and gutter and setter 
  }
  </code></pre>