C# Queue Queue(ICollection)

Description

Queue Queue(ICollection) initializes a new instance of the Queue class that contains elements copied from the specified collection, has the same initial capacity as the number of elements copied, and uses the default growth factor.

Syntax

Queue.Queue(ICollection) has the following syntax.


public Queue(
  ICollection col
)

Parameters

Queue.Queue(ICollection) has the following parameters.

  • col - The ICollection to copy elements from.

Example


using System.Collections;
using System;//from w w w  .  j  ava2  s . c  o  m
public class MainClass
{
  public static void Main(String[] argv){  
    ICollection myCollection = new Queue();

    Queue myCollection1 = new Queue(myCollection);

  }
}
   

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Collections »




ArrayList
BitArray
Comparer
Hashtable
Queue
SortedList
Stack