why is hashCode() for String object different from hashCode() of a custom class' object?
<p>Why is the hashcode of <code>stringObject</code> is the string I provided?</p>

<pre><code>String s = new String(); // here the hascode is 0. 
</code></pre>

<p>But when i get the hashcode of some object i created.</p>

<pre><code>testClass o = new testClass(); // the hashcode is some random number.
</code></pre>

<p>My question is what is the difference between the two? My understanding is <code>hashCode()</code> is from <code>Object</code> class which is the mother of all class.</p>
