title: Trying to print a hash table but i keep getting the memory location
body: <p>Hey I keep trying to print my hash table but even when I use my toArray and toString methods all it prints is the memory location. I'm really confused because I thought toArrays and toStrings were for this very problem. Any help would be appreciated. </p>
  
  <p>I declare my hash table like this:</p>
  
  <pre><code> HashTable&lt;Integer,EmployeeInfo&gt; phone =  new HashTable&lt;&gt;(300);
  </code></pre>
  
  <p>Again, when I try to do these all I get is the memory location and not the actual data that the hash table holds. For example when I do phone.toString() all I get is: hashing.HashTable@55f96302. Any help would be appreciated, thanks :).</p>
  
  <pre><code>package hashing;
  
  import java.util.Arrays;
  
  public class Hash {
  
  public static void main(String[] args) {
      // TODO Auto-generated method stub
  
       HashTable&lt;Integer,EmployeeInfo&gt; phone =  new HashTable&lt;&gt;(300);
       System.out.println(phone.toString());
  }
  
  public static class HashTable&lt;K,V&gt;
  {
      private int numberEntries;
      private static final int DEFAULT_CAPACITY = 5;
  
      private HashHolder&lt;K,V&gt;[] hashTable;
      private int tableSize;
  
      public HashTable()
      {
          this(DEFAULT_CAPACITY);
      }
  
  
      public HashHolder&lt;K,V&gt;[] toArray()
      {
          int size = hashTable.length;
          @SuppressWarnings("unchecked")
          HashHolder&lt;K,V&gt;[] tempArray = Arrays.copyOf(hashTable,size);//(HashHolder&lt;K,V&gt;[]) new Object[size];
          return tempArray;
      }
      public HashTable(int initCapacity)
      {   
          //Note: I'm not implementing a rigorous check for capacity constraints here.  I probably should...
          @SuppressWarnings("unchecked")
          HashHolder&lt;K,V&gt;[] temp = (HashHolder&lt;K,V&gt;[]) new HashHolder[initCapacity];
          hashTable = temp;
  
          numberEntries = 0;
      }
  
  
  
  }
  
  public static class HashHolder&lt;K,V&gt; 
  {
      private K hashKey;
      private V data;
      private HashHolder&lt;K,V&gt; next;
      private States state;
      private enum States {CURRENT,REMOVED};
  
  
      @Override
      public String toString()
      {
          if(state != States.REMOVED)
              return String.format("%s: %s", hashKey.toString(), data.toString());
          else
              return String.format("REMOVED");
      }
      public HashHolder(K key, V value)
      {
          hashKey = key;
          data = value;
          state = States.CURRENT;
      }
  
  }
  
  }
  </code></pre>