title: Inserting Integers into a TreeMap
body: <p>I want to store the IDs of items and their corresponding co-ordinates. For this, I'm using a TreeMap where Coordinates is a class containing int x and int y. Now, for inserting data into the map can I write:</p>
  
  <pre><code>treeMapObject.put(5,new BasicRow(30,90));
  </code></pre>
  
  <p>Or do I have to write:</p>
  
  <pre><code>treeMapObject.put(new Integer(5),new BasicRow(30,90));
  </code></pre>
  
  <p>I guess only the second one is correct because Maps deal with objects. But now the question is, say I have the following piece of code:</p>
  
  <pre><code>treeMapObject.put(new Integer(5),new BasicRow(30,90));
  treeMapObject.put(new Integer(5),new BasicRow(45,85));
  </code></pre>
  
  <p>In such a case what will happen?</p>