Define Collections in .NET and briefly explain its types

 Posted by deccansoft on 9/27/2010 | Category: C# Interview questions | Views: 6468

From a .NET perspective, a collection could be defined as an object that
implements one or more of the System.Collections.ICollection,
System.Collections.IDictionary, and System.Collections.IList interfaces.
This definition leads to my classification of the "built-in"
collections found in the System.Collections namespace into three broad

•Ordered collections: Collections that implement only the
ICollection interface are usually distinguished by the fact that
insertion order controls the order in which objects may be retrieved
from the collection. The System.Collections.Stack and
System.Collections.Queue classes are both examples of ICollection

•Indexed collections: IList-implementing collections are
distinguished by the fact that their contents can be retrieved via a
zero-based numeric index, like an array. The
System.Collections.ArrayList object is one example of an indexed

•Keyed collections: Collections implementing the IDictionary
interface contain items that can be retrieved by an associated key value
of some kind. The contents of IDictionary collections are also usually
sorted in some fashion based on the key value and can be retrieved in
sorted order by enumeration. The System.Collections.HashTable class
implements the IDictionary interface

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: Shanky11 on: 1/31/2013
what is the exact defintion of it what anser can ew exactly give

Login to post response