Check if the ArrayList is read-only in CSharp
Description
The following code shows how to check if the ArrayList is read-only.
Example
using System; /*from w w w. ja v a 2 s . co m*/
using System.Collections;
class MainClass {
public static void Main() {
ArrayList al = new ArrayList();
al.Add('C');
al.Add('A');
al.Add('E');
al.Add('B');
al.Add('D');
al.Add('F');
Console.WriteLine(al.IsReadOnly);
}
}
The code above generates the following result.