title: Difference between putting primitive or object to an object map in Java
body: <p>I have a simple map:</p>
  
  <pre><code>Map&lt;String, Object&gt; myMap;
  </code></pre>
  
  <p>And I am just wondering, what is the difference between these two solutions:
  First, when I put my <code>double</code> value as a <code>Double</code> object:</p>
  
  <pre><code>myMap.put("object", Double.valueOf(myPrimitiveDouble));
  </code></pre>
  
  <p>Second when I put my <code>double</code> value as a primitive type:</p>
  
  <pre><code>myMap.put("primitive", myPrimitiveDouble);
  </code></pre>
  
  <p>I think the first one is unnecessary, am I right?
  Thanks for the answers!</p>