Removes and returns the object at the head of the Queue.
[Visual Basic] Overridable Public Function Dequeue() As Object [C#] public virtual object Dequeue(); [C++] public: virtual Object* Dequeue(); [JScript] public function Dequeue() : Object;
The object removed from the head of the Queue, if the Queue is not empty; otherwise, a null reference (in Visual Basic Nothing).
Exception Type | Condition |
---|---|
InvalidOperationException | The Queue is empty. |
This method can be overridden by a derived class.
This method is similar to the Peek method, but Peek does not modify the Queue.
This method is an O(1) operation.
Queue Class | Queue Members | System.Collections Namespace | Enqueue | Peek