Home  >  Article  >  Backend Development  >  What does the IList interface in C# do?

What does the IList interface in C# do?

WBOY
WBOYforward
2023-08-28 16:13:021302browse

C# 中的 IList 接口有什么作用?

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

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

isReadOnly

Gets a value indicating whether the IList is read-only.

Mr. Number Property name and description th>
1 Count

Get the number of elements contained in the numeric ICollection.

2 isFixedSize

Gets a value indicating whether the IList has a fixed size.

3
4 isSynchronized

Gets a value indicating whether access to the ICollection is synchronized.

5 Item(Int32)

Gets or sets the element at the specified position

The following are the methods of the IList interface-

Mr. Number Attributes Name and Description
1 Add(Obj)

Add items to IList.

2 Clear()

Remove all items from IList

3 Contains(Obj)

Whether the list contains a specific value

4 td> GetEnumerator()

Returns the enumerator

5 IndexOf(Obj)

The index of the specified item in IList

6 Remove(Obj)

This method deletes the first occurrence of a specific object. p>

The above is the detailed content of What does the IList interface in C# do?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete
Previous article:C# object serializationNext article:C# object serialization