title: Why the Hashcode of the HashMap is Zero
body: <p>I am trying to initialize with Approach One:</p>
  
  <pre><code>Map&lt;String, String&gt; mapInter = Collections.EMPTY_MAP;
  mapInter = new HashMap&lt;String, String&gt;();
  mapInter.put("one", "one");
  System.out.println(mapInter.hashCode());        
  </code></pre>
  
  <p>Approach  two :</p>
  
  <pre><code>HashMap&lt;String, String&gt; myMap = new HashMap&lt;String, String&gt;(10);
  myMap.put("key", "value");
  System.out.println(myMap.hashCode());
  </code></pre>
  
  <p>In first approach when i print hashcode it's print zero, but in second approach it print hash code. after initialization hashcode will be returned.</p>
  
  <p>Why the HashCode in the first Case Printed zero but not in the second case?</p>