Last Updated : 11 Jul, 2025
ArrayListrepresents an ordered collection of an object that can be indexed individually. It is basically an alternative to an array. It also allows dynamic memory allocation, adding, searching and sorting items in the list.
ArrayList.IsReadOnlyproperty is used to check whether the ArrayList is read-only or not.
Properties:public virtual bool IsReadOnly { get; }Return Value:
This method returns
Trueif the ArrayList is read-only, otherwise returns
False. The default value is
False.
Example: CSHARP
// C# code to check if the ArrayList
// is read-only or not
using System;
using System.Collections;
using System.Collections.Generic;
class GFG {
// Driver code
public static void Main()
{
// Creating an ArrayList
ArrayList myList = new ArrayList();
// Adding elements to ArrayList
myList.Add("Geeks");
myList.Add("for");
myList.Add("Geeks");
myList.Add("Noida");
myList.Add("Geeks Classes");
myList.Add("Delhi");
// To check if the ArrayList is read-only or not
Console.WriteLine(myList.IsReadOnly);
}
}
Note:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4