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 Stack
Stack st = new Stack();
Object Stack.Pop() : Return the last object in the Stack
The following ASP.NET program push seven days in a week and bing it to a ListBox control.
Click the following links to see full source code