Inserts an object at the top of the Stack.
[Visual Basic] Overridable Public Sub Push( _ ByVal obj As Object _ ) [C#] public virtual void Push( object obj ); [C++] public: virtual void Push( Object* obj ); [JScript] public function Push( obj : Object );
None.
This method can be overridden by a derived class.
Stack is implemented as a circular buffer. Push is an O(n) operation; Pop is an O(1) operation.
a null reference (in Visual Basic Nothing) can be pushed onto the Stack as a placeholder, if needed. It occupies a slot in the stack and is treated like any object.
Stack Class | Stack Members | System.Collections Namespace | Peek | Pop