title: Hashtable. How it works?
body: <p>Now, I'm trying to understand how to construct the <code>Hashtable</code>.</p>
  
  <p>The most interesting - as objects are added to the <code>Hashtable</code>?</p>
  
  <p>I have read in a book that:</p>
  
  <p>at first step:
  Calculated <code>hashCode()</code> object.</p>
  
  <p>Next, we determine the position of this object in the <code>Hashtable</code>: <code>obj.hashCode() % Hashtable.length</code>.</p>
  
  <p>For example, add more elements to the <code>Hashtable</code>:</p>
  
  <pre><code>Hashtable&lt;String, String&gt; hm=new Hashtable&lt;String, String&gt;(100);
  
          hm.put("Lee","Lee");
          hm.put("lee","lee");
          hm.put("eel","eel");
  </code></pre>
  
  <p>Define a bucket into which is placed the object:</p>
  
  <pre><code>    System.out.println("Lee".hashCode() % 100);
      System.out.println("lee".hashCode() % 100);
      System.out.println("eel".hashCode() % 100);
  </code></pre>
  
  <p>If I understand the algorithm, the objects must be placed in the table as follows:</p>
  
  <pre><code>eel /*because,"eel".hashCode() % 100=0*/, 
  lee /*because, "lee".hashCode() % 100=20*/, 
  Lee /*because, "Lee".hashCode() % 100=68*/
  </code></pre>
  
  <p>but what we see as a result?</p>
  
  <pre><code>System.out.println(hm);
  
  {Lee=Lee, lee=lee, eel=eel} 
  </code></pre>
  
  <p>Please, tell me, where did I go wrong?</p>