What does the interface IList do in C#?

CsharpProgrammingServer Side Programming

The IList interface has a non-generic collection of objects that can be individually accessed by index.

The following are the properties of interface IList in C# −

Sr.NoProperty Name & Description
1Count
Gets the number of elements contained in the ICollection.
2isFixedSize
Gets a value indicating whether the IList has a fixed size.
3isReadOnly
Gets a value indicating whether the IList is read-only.
4isSynchronized
Gets a value indicating whether access to the ICollection is synchronized.
5Item(Int32)
Gets or sets the element at the specified index.

The following are the methods of the IList interface −

Sr.NoProperty Name & Description
1Add(Obj)
Adds an item to the IList.
2Clear()
Removes all items from the IList
3Contains(Obj)
Whether the list contains a specific value
4GetEnumerator()
Returns an Enumerator
5IndexOf(Obj)
Index of the specified item in the IList
6Remove(Obj)
The method removes the first occurrence of a specific object.
raja
Published on 09-Aug-2018 07:29:36
Advertisements