Will I get bugs if I use a string for a hashtable key in java?
<p>I want to use a hashtable to uniquely link immutable string IDs to mutable objects. If I have two strings of the same characters, will Java interpret them as different keys to the hash table? I know that Strings are objects, so two strings might not have the same reference. </p>

<p>In other words, if I do ...</p>

<pre><code>myHashTable.add("A" , ObjectA)
String myReference = "A" 
myHashTable.add(myReference, ObjectB) // I am not sure how java will interpret this
myHashTable.get("A") //returns A
myHashTable.get(myReference) //returns B
myReference.equals("A") //returns true
</code></pre>

<p>Can I safely use strings as keys to the hashtable (meaning that strings made up of the same characters will return the same value)</p>
