Do Hashmaps optimize memory if values are duplicated?
<p>Example:</p>

<p>Say I want to create a Hashmap with 26 keys which will be <code>'A'</code> through <code>'Z'</code> for this example. Now let's say that I want keys <code>'A'</code>, <code>'M'</code>, and <code>'Z'</code> to return the same integer value of <code>123</code>. When this map is created, does the map get optimized such that only one value is stored in memory? Or does it still treat this as 3 different keys with 3 different values, even though the 3 values are the same.</p>

<p>I hope that question makes sense.</p>

<p>Thanks</p>
