Stack Members

The following tables list the members exposed by the Stack type.

Public Constructors

Name Description
Public Method Stack Initializes a new instance of the Stack class that is empty and that has the default initial capacity.

Public Properties

Name Description
Public Property Count Gets the number of elements contained in the Stack.
Public Property IsSynchronized Gets a value indicating whether the current stack is synchronized. Always returns false.
Public Property SyncRoot Gets an object that can be used to synchronize access to the Stack.

Public Methods

Name Description
Public Method Clear Removes all objects from the Stack.
Public Method Clone Creates a shallow copy of the Stack.
Public Method Contains Determines whether an element is in the Stack.
Public Method CopyTo Copies the Stack elements to an existing one-dimensional Array starting at the specified array index.
Public Method Equals (Inherited from Object.)
Public Method GetEnumerator Returns an enumerator that iterates through the Stack.
Public Method GetHashCode (Inherited from Object.)
Public Method GetType (Inherited from Object.)
Public Method Peek Returns the object at the top of the Stack without removing it.
Public Method Pop Removes the object at the top of the Stack, and returns it.
Public Method Push Inserts an object at the top of the Stack.
Public Method ReferenceEquals (Inherited from Object.)
Public Method ToArray Copies the Stack to a new array, in the same order Pop would return the items.
Public Method ToString (Inherited from Object.)

Protected Methods

Name Description
Protected Method Finalize (Inherited from Object.)
Protected Method MemberwiseClone (Inherited from Object.)

See Also

Reference

Stack Class
System.Collections Namespace