title: HashMap default types for K and V
body: <p>I usually type my map declarations but was doing some maint and found one without typing.  This got me thinking (Oh No!).  What is the default typing of a Map declaration.  Consider the following:</p>
  
  <pre><code>Map map = new HashMap();
  map.put("one", "1st");
  map.put("two", new Integer(2));
  map.put("three", "3rd");
  for (Map.Entry entry : map.entrySet()) {
      System.out.println(entry.getKey() + " -&gt; " + entry.getValue());
  }
  </code></pre>
  
  <p>this errors with a incompatible types on Map.Entry.  So if I type the declaration with:</p>
  
  <pre><code>Map&lt;Object, Object&gt; map = new HashMap();
  </code></pre>
  
  <p>then all works well.  So what is the default type that gets set in the declaration about?  Or am I missing something else?</p>