title: Using an instance of an object as a key in hashmap, and then access it with exactly new object?
body: <p>I have a hasmap with a key object, </p>
  
  <pre><code>HashMap&lt;Key, Object&gt; test;
  </code></pre>
  
  <p>and make new Key("the same") as key..</p>
  
  <p>so its like..:</p>
  
  <pre><code>test.put(new Key("the same"), someObject);
  </code></pre>
  
  <p>(without storing that key in a variable)</p>
  
  <p>so.. after a while... i want to access the hashmap,
  because i do not have the object, i've tried to make new Key("the same") and make it as a key.
  But it didnt work.</p>
  
  <p>How to make it work? (without saving the first object "key" in a variable)</p>
  
  <p>So meanwhile, for now, im using String object as a key.</p>
  
  <pre><code>HashMap&lt;String, Object&gt;
  </code></pre>