Is using the Class instance as a Map key a best practice?
<p>I have read somewhere that using the class instances as below is not a good idea as they might cause memory leaks. Can someone tell me if if that is a valid statement? Or are they any problems using it this way?</p>

<pre><code>Map&lt;Class&lt;?&gt;,String&gt; classToInstance=new HashMap();

classToInstanceMap.put(String.class,"Test obj");
</code></pre>
