Home > Backend Development > C#.Net Tutorial > What is the role of the ICollection interface in C#

What is the role of the ICollection interface in C#

WBOY
Release: 2023-09-09 16:33:04
forward
875 people have browsed it

C# 中 ICollection 接口的作用是什么

In C#, the ICollection interface defines the size, enumerators and synchronization methods of all non-generic collections. It is the basic interface for classes in the System.Collections namespace.

The following are the properties of the ICollection interface:

Serial number Property name and description
1 Count

#Number of elements in ICollection

2 SyncRoot

Get an object for synchronous access to ICollection.

The following are the methods of the ICollection interface:

##12
Serial number Method name and description
CopyTo(Array^,Int32)This method copies the elements of ICollection into an array.

GetEnumerator()The GetEnumerator() method returns a collection for iteration enumerator.

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

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template