title: What is a read only collection?
body: <p>I ran a security code analyst i found myself having a <a href="http://msdn.microsoft.com/en-us/library/ms182299.aspx" rel="noreferrer">CA2105 warning</a>. I looked at the grade tampering example. I didn't realize you can assign int[] to a readonly int. I thought readonly was like the C++ const and makes it illegal.</p>
  
  <p>The How to Fix Violations suggest i clone the object (which i don't want to do) or 'Replace the array with a strongly typed collection that cannot be changed'. I clicked the link and see 'ArrayList' and adding each element one by one and it doesn't look like you can prevent something adding more.</p>
  
  <p>So when i have this piece of code what is the easiest or best way to make it a read only collection?</p>
  
  <pre><code>public static readonly string[] example = { "a", "b", "sfsdg", "sdgfhf", "erfdgf", "last one"};
  </code></pre>