System.Collections.Generic


System.Collections.Generic.Dictionary 
System.Collections.Generic.HashSet 
System.Collections.Generic.LinkedList 
System.Collections.Generic.List 
System.Collections.Generic.Queue 
System.Collections.Generic.SortedDictionary 
System.Collections.Generic.SortedList 
System.Collections.Generic.Stack 

System.Collections.Generic.KeyValuePair

Added in .NET 2.0


System.Collections.Generic.HashSet

Added in .NET 3.5
System.Collections.Generic.HashSet
Fast hash-based lookup to find a given value
Items cannot be accessed by their position
Elements are unique
All these methods accept parameters of type IEnumerabe<T>


System.Collections.Generic.LinkedList

Added in .NET 2.0
This type of collection represtns a collection on keys and values
A double linked list, provides immediate access to first and last items


System.Collections.Generic.Queue

Added in .NET 2.0
Represents a generic queue of objects
A queue represents a first-in, first out collection (FIFO)
items are added with "Enqueue" and removed with "Dequeue"
The "Peek" method retrieves the oldest object but does not remove it.
For example you might want to send messages to a resource that can only handle one message at a time.
The queue class is a good collection to use when you are managing a limited resource

System.Collections.Generic.Queue 

This class is not to be confused with the Non Generic Queue class introduced in .NET 1.1


System.Collections.Generic.SortedDictionary

Added in .NET 2.0
Implements a lookup system
objects made available through unique keys
keeps records sorted using a binary search tree
If the TKey data type implements the IComparer interface, that types comparison rules are used for the sort.


System.Collections.Generic.SortedList

Added in .NET 2.0
implements an ordered list
items are sorted by key as they are added
Identical to SortedDictionary but it is optimised for fast insertion of previously sorted data.


This represents a collection of keys/pairs that are sorted by the keys and are accessible by key and by index.
As elements are added the capacity is automatically increased as required.
The capacity can be reduced by calling TrimToSize or by explicitley settings the Capacity property


System.Collections.Generic.SortedList 

objSortedList.Count 
objSortedList.Capacity
objSortedList.GetByIndex
objSortedList.GetKey

This class is not to be confused with the Non Generic SortedList Class introduced in .NET 1.1



System.Collections.Generic.SortedSet

Added in .NET 4.0
Represents a collection of objects that are maintained in a sorted order


System.Collections.Generic.Stack

Added in .NET 2.0
A stack represents a last in, first out collection (LIFO)
The principle methods for adding to and removing from are the Push and Pop methods
generic stack of objects
a list in first out structure


Methods

ClearRemoves all objects
ContainsDetermines if an element exists
CopyToCopies the stack elements to an existing one-dimensional array
Count 
GetEnumerator 
PeekReturns the object at the top of the stack without removing it
PopRemoves the object at the top of the stack
PushInserts an object at the top of the stack
ToArrayCopies the stack elements to a new one dimensional array

private class BET_GenericStack : System.Collections.Generic.Stack 
{
}

int mysize = 10; 
int myvalue;
int mytotal;
BET_GenericStack<double> myStack;
myStack = new BET_GenericStack<double>(mysize);

for (int i=0; I < mysize; i++)
{
   myStack.Push(i);
   System.Console.Writeline("Pushed - " + i);
}

for (int i=0; I < mysize; i++)
{
   myvalue = myStack.Pop();
   mytotal += myvalue;
   System.Console.Writeline("Popped - " + myvalue);
}
System.Console.WriteLine("Total - " + mytotal);

This class is not to be confused with the Non Generic Stack class that was introduced in .NET 1.1


System.Collections.Generic.ICollection<T>

Added in .NET 2.0
This is an interface for collections of objects


This is the common interface for all the different collection objects.
You can add an item to the collection
You can remove/clear all the items from a collection
You can check if an item/value exists in a collection
You can copy all the items in the collection to an array
You can get the total number of items in a collection
You can remove the first occurrence of a given value
You can check if a collection is read only
Add elements to the collection
Remove all the elements from the collection
Quickly identify if an element exists
Copy all the elements to an array
Get the total number of elements
Remove the first occurrence of a particular value
Check if the collection is read-only
Defines methods to manipulate generic collections

public interface ICollection<T> : IEnumerable<T>, IEnumerable 


© 2026 Better Solutions Limited. All Rights Reserved. © 2026 Better Solutions Limited TopPrevNext