title: Is it because of string pooling by CLR or by the GetHashCode() method?
body: <p>Is it because of string pooling by CLR or by the GetHashCode() method of both strings return same value?</p>
  
  <pre><code>string s1 = "xyz";
  string s2 = "xyz";
  Console.WriteLine(" s1 reference equals s2 : {0}", object.ReferenceEquals(s1, s2));
  </code></pre>
  
  <p>Console writes : <strong>"s1 reference equals s2 : True"</strong></p>
  
  <p>I believe that, it's not because of the GetHashCode() returns same value for both string instance. Because, I tested with custom object and overridden the GetHasCode() method to return a single constant every time. The two separate instances of this object does not equal in the reference.</p>
  
  <p>Please let me know, what is happening behind the scene.</p>
  
  <p>thanks 
  123Developer </p>