asp.net.ph

ICollection Interface

System.Collections Namespace


Defines size, enumerators and synchronization methods for all collections.

ICollection Interface Members

Collapse   Properties

Visibility Name Value Type Accessibility
public Count Int32 [ Get ]
public IsSynchronized Boolean [ Get ]
public SyncRoot Object [ Get ]

Collapse   Methods

Visibility Name Parameters Return Type
public CopyTo ( Array array , Int32 index ) Void

Remarks

The ICollection interface is the base interface for classes in the System.Collections namespace.

The ICollection interface extends IEnumerable.

IDictionary and IList are more specialized interfaces that are based on the ICollection interface.

  • An IDictionary implementation is a collection of key-and-value pairs, like the Hashtable class.
  • An IList implementation is a collection of values that can be sorted and whose members can be accessed by index, like the ArrayList class.

If neither the IDictionary interface nor the IList interface meet the requirements of the required collection, derive the new collection class from the ICollection interface instead for more flexibility.

Some collections that limit access to their elements, like the Queue class and the Stack class, directly implement the ICollection interface.

See Also

IDictionary Interface   IEnumerable Interface   IList Interface Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph