The IsReadOnly property of ArrayList class is useful to get a value indicating whether the ArrayList is read-only.
Firstly, we have the following ArrayList.
ArrayList arrList = new ArrayList();
Then we have checked using the IsReadOnly Property.
Console.WriteLine("myArrayList.IsReadOnly = " + arrList.IsReadOnly);The following is an example showing how to work with IsReadOnly property in ArrayList class.
Example
using System;
using System.Collections;
class Demo {
public static void Main() {
ArrayList arrList = new ArrayList();
Console.WriteLine("myArrayList.IsReadOnly = " + arrList.IsReadOnly);
}
}Output
myArrayList.IsReadOnly = False