title: Correct way to initialize HashMap and can HashMap hold different value types?
body: <p>So I have two questions about <code>HashMap</code>s in Java:</p>
  
  <ol>
  <li><p>What is the correct way to initialize a <code>HashMap</code>? I think it might be best in my situation to use:</p>
  
  <pre><code>HashMap x = new HashMap();
  </code></pre>
  
  <p>But Eclipse keeps suggesting that I use:</p>
  
  <pre><code>HashMap&lt;something, something&gt; map = new HashMap();
  </code></pre>
  
  <p>Which is better?</p></li>
  <li><p>Can a <code>HashMap</code> hold different types of objects/data types as values? For example, would this work and be OK:</p>
  
  <pre><code>map.put("one", 1);
  map.put("two", {1, 2});
  map.put("three", "hello");
  </code></pre>
  
  <p>In the first <code>put()</code>, I want an <code>int</code> as a value, in the second an <code>int[]</code>, and third a string. Is this okay to do in Java with <code>HashMap</code>s? Also, is it okay to store a <code>HashMap</code> as a value within a <code>HashMap</code>?</p></li>
  </ol>