title: adding the same key twice in the Map
body: <p>I was doing research on <code>Map</code>s and I discovered that if I add the same key twice deliberately then the size of the Map remains the same. What's the technical reason behind this? </p>
  
  <pre><code> Map map=new HashMap();//HashMap key random order.
           map.put("Amit","Java");
           map.put("Amit","Java");
  </code></pre>
  
  <p>Code for retrieving...</p>
  
  <pre><code>System.out.println("There are "+map.size()+" elements in the map.");
           System.out.println("Content of Map are...");
           Set s=map.entrySet();
           Iterator itr=s.iterator();
           while(itr.hasNext())
           {
               Map.Entry m=(Map.Entry)itr.next();
               System.out.println(m.getKey()+"\t"+m.getValue()+"\t"+ m.hashCode());
            }
  </code></pre>
  
  <p>The result that I get:</p>
  
  <pre><code>There are 1 elements in the map.
  Content of Map are...
  Amit    Java    3943477
  </code></pre>