Queue.Dequeue Method

   
Queue.Dequeue Method

Class

System.Collections.Queue

Syntax

   queuevariable   .Dequeue(  ) 

Return Value

Object

Description

Removes the first item from the queue and returns it as an Object

Rules at a Glance

  • Dequeue removes the item at the beginning of the queue and decrements the Count property by one.

  • The Dequeue method generates an error if applied to an empty queue. Thus, it may be advisable to check for an empty queue using the Count property before attempting to dequeue.

Programming Tips and Gotchas

Dequeue is similar to the Peek method. The Peek method returns a reference to the object at the beginning of the queue, but unlike the Dequeue method, does not remove it from the queue.

See Also

Queue.Peek Method

   


VB.Net Language in a Nutshell
VB.NET Language in a Nutshell
ISBN: B00006L54Q
EAN: N/A
Year: 2002
Pages: 503

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net