title: Are collections Mutable?
body: <p>In the below example the changes made in the <code>List B</code> directly reflect int the <code>List A</code>.   </p>
  
  <pre><code>   List&lt;string&gt; A = new List&lt;string&gt;();
     A.Add("1");
     List&lt;string&gt; B = new List&lt;string&gt;();
     B = A;
     foreach (string value in B)
     {
         Console.WriteLine("B= " + value);
     }
     B.Add("2");
     foreach (string value in A)
     {
         Console.WriteLine("A= " + value);
     }
  </code></pre>
  
  <p>the Output is </p>
  
  <blockquote>
    <p>B=1</p>
    
    <p>A=1</p>
    
    <p>A=2</p>
  </blockquote>
  
  <p>Also the output is the same even if I use an <code>Arraylist</code> .</p>
  
  <p>In case of a string the behavior is otherwise!</p>
  
  <pre><code>String s1 = "abc";
  String s2 = s1;
  s2 += "TEST";
  Console.WriteLine("S1=" + s1 + "    S2=" + s2);
  </code></pre>
  
  <p>the Output is </p>
  
  <blockquote>
    <p>S1=abc     S2=abcTEST</p>
  </blockquote>