title: Array with literal strings
body: <p>I am having a <code>string</code> array initialized with literal strings as below:</p>
  
  <pre><code>public static void Main()
  {
       string[] values = new string[] { "Cat", "Dog", "Mouse", "Rat" };
  }
  </code></pre>
  
  <p>So we have following structure on Stack and Heap:</p>
  
  <p><strong>OnStack:</strong> A variable <code>values</code> holding reference to the array of string on heap.</p>
  
  <p><strong>OnHeap:</strong> The array of string which is referenced by <code>values</code> on stack</p>
  
  <hr>
  
  <p>But what will be the content of each element of the array on heap ?</p>
  
  <blockquote>
    <ol>
    <li>Actual string literals ?</li>
    <li>References pointing to string literals in intern pool ?</li>
    </ol>
  </blockquote>
  
  <hr>
  
  <p><strong>Edit:</strong> The question was pointed as duplicate to <a href="https://stackoverflow.com/questions/5087987/how-is-an-array-of-value-types-stored-in-net-object-heap">this question</a>. But my case is different in terms that</p>
  
  <ol>
  <li>Another question was in context to how value type as elements of array behave, that showed that question poser was not clear how ref/val type objects are allocated on stack/heap.</li>
  <li>In my question I am clear how ref/val type elements are allocated on stack or heap but I am discussing the special case when the objects are string literals. Because that has to deal with intern pool and GC.</li>
  </ol>