Adds an object to the tail of the Queue.
[Visual Basic] Overridable Public Sub Enqueue( _ ByVal obj As Object _ ) [C#] public virtual void Enqueue( object obj ); [C++] public: virtual void Enqueue( Object* obj ); [JScript] public function Enqueue( obj : Object );
None.
Exception Type | Condition |
---|---|
ArgumentNullException | obj is a null reference (in Visual Basic Nothing). |
This method can be overridden by a derived class.
When the number of elements in the Queue reaches its capacity, the capacity is automatically increased to accommodate more elements.
This method is an O(n) operation.
Queue Class | Queue Members | System.Collections Namespace | Dequeue | Peek