Home >Backend Development >C#.Net Tutorial >What is the role of the ICollection interface in C#
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:
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!