August 2003
Intermediate to advanced
928 pages
32h 1m
English
ICollection
This interface defines the
basic
characteristics of
collection objects and implements three properties.
Count gets the number of elements contained in a
collection; IsSynchronized indicates whether the
collection is thread-safe, and SyncRoot returns an
object that synchronizes access to the collection (this is the object
itself if the implementing class does not provide a
Synchronized( ) method).
ICollection also implements the CopyTo( ) method for copying elements to an
Array object at a specified index.
public interface ICollection : IEnumerable { // Public Instance Properties public int Count{get; } public bool IsSynchronized{get; } public object SyncRoot{get; } // Public Instance Methods public void CopyTo(Arrayarray, intindex); }
Multiple types
Multiple types
ArrayList.{AddRange( ), ArrayList( ), InsertRange( ), SetRange( )}, Queue.Queue( ),
Stack.Stack( )