The Stack class represents a last-in-first-out (LIFO) Stack of Objects. Stack follows the push-pop operations, that is we can Push Items into Stack and Pop it later also it follows the Last In First Out (LIFO) system.
Stack returns the last item first. As elements are added to a Stack, the capacity is automatically increased as required through reallocation.
Stack.Push(Object) : Add (Push) an item in the Stack data structure.
Dim st As New Stackst.Push("Sunday")
Stack st = new Stack();st.Push("Sunday");
Object Stack.Pop() : Return the last object in the Stack
vb.net st.pop()
C# st.pop();
The following ASP.NET program push seven days in a week and bing it to a ListBox control.
Default.aspx
Untitled Page
Click the following links to see full source code
C# Source Code
VB.NET Source Code
ASP.NET Collection - Related Contents
ASP.NET Related Topics