.NET FAQs Unleashed!
 
    



    


Which interfaces belong to the System.Collections namespace? Which classes belong to the System.Collections namespace?

Objects deriving from System.Collections have the ability to resize, depending on the size of the values in the container, unlike objects deriving from System.Array. They have methods to sort, reverse, clear, enumerate the entities inside them.

The following are the interfaces that belong to the System.Collections namespace:

1) ICollection - this interface defines generic properties for a class

2) IComparer - this interface allows two or more objects to be compared

3) IDictionary - this interface defines an object in a series of name - value pairs

4) IDictionaryEnumerator - provides an enumerated value to they types that implement IDictionary interface

5) IEnumerable - this interface allows return of an IEnumerator interface for an object

6) IEnumerator - This interface allows the iteration of types inside it

7) IHashCodeProvider - This interface allows returning of the hashcode for the implementing type with the use of hash-based algorithms

8) IKeyComparer - This interface has been introduced in .NET 2.0 Framework. It is a fusion of the functionalities and features that come in the IComparer and IHashCodeProvider interfaces.

9) IList - This interface allows addition, removal and indexing of items in an object list. Types implementing this may be read-only and of fixed size.

The following are the classes that belong to the System.Collections namespace:

1) ArrayList - This type may be used to contain any object. The size of this object is variable, and is dynamically decided depending on the number of entities added or removed from it. It implements IList, ICollection, IEnumerable and ICloneable interfaces.

2) Hashtable - This type may be used to contain any object, with each entity identifiable by a unique numeric key. If a custom type is stored inside a Hashtable object, then it must override the System.Object.GetHashCode() method. It implements the IDictionary, ICollection, IEnumerable, ICloneable interfaces.

3) Queue - This type is used to store entities in a manner so as to enable First-in-First-out processing. It implements ICollection, IEnumerable, ICloneable interfaces.

4) SortedList - The entities inside this type are sorted like in a dictionary. Also, the entities in this type of object may be accessed using an index. This implements the IDictionary, ICollection, IEnumerable and ICloneable interfaces.

5) Stack - This type is used to store entities in a manner so as to enable Last-in-First-out processing. It implements ICollection, IEnumerable, ICloneable interfaces.

 

 

Protected Internal  Array  Sort Array  Throw  Multiple Catch  Polymorphism  Inheritance  Session Viewstate  Autogenerate  ReadOnly  Sealed Class  Sealed Method  Multiple Interfaces  Overloading  Overloaded Constructors  Generics  Main  Case Sensitive  Console  Specifier  Return Type  SetCommandLineArgs  System Environment  New  Default Values of Types Compiler Error Constant Variable Const Const - ReadOnly Parameter Modifier Out Ref Interface Interface Reference, is, as System.Collection

More Interview Questions...
Skip Navigation Links
  Design Patterns  
  Ajax
  Security
  C#
  ASP.NET
 ASP.NET 2.0
 Articles
SQL
Skip Navigation Links
  OOPs 
  Framework
  ADO.NET
  100 Short Q-As
  Difference Between Q-As
  .NET Acronyms
  Discussions




ShoutMix chat widget





Know Your Breath, Know Your Life!!!