title: How to print the initial hash and actual hash entry position for each entry
body: <p>I tried adding print statements in the (put) method of HashTable to print the initial hash and actual hash entry for each entry everytime the program runs. But i couldnt do it. My HashTable is using linear probing and i have attached the code (put method). Please help me as i am pretty new to programming so any help will be much appreciated.
  `</p>
  <pre><code>    int hashIdx = hash(inKey);
      int initIdx = hashIdx;
      int i = 1;
  
      while (hashArray[hashIdx] != null &amp;&amp; !hashArray[hashIdx].getKey().equals(inKey)) {
  
          if (!hashArray[hashIdx].getKey().equals(inKey)) { 
              if (hashArray[hashIdx].getState() == 1) { 
                  hashIdx = (initIdx + i) % hashArray.length; 
              }
  
              if (hashArray[hashIdx].getState() &lt; 1) { 
                  hashArray[hashIdx] = new HashEntry(inKey, inValue); 
                  hashCount++; 
              }
          }
          i++; 
      } 
  
  }``
  </code></pre>