What does the interface IList do in C#?


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.

karthikeya Boyini
karthikeya Boyini

I love programming (: That's all I know

Updated on: 20-Jun-2020

690 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements