Overview
- Last-in, first-out (LIFO) logic.
- Acts as a stack of papers on a desk.
Good practice
- When possible, use the generic Stack<T> instead.
Examples
Push and Pop
Stack s = new Stack();
s.Push("Hello");
s.Push("World");
Console.WriteLine(s.Pop() + " " + s.Pop());
Stack<string> sg = new Stack<string>();
sg.Push("Hello");
sg.Push("World");
Console.WriteLine(sg.Pop() + " " + sg.Pop());
You May Also Like

Exam 70-536 Study Notes
My study notes for Microsoft exam 70-536: .NET types, collections, generics, I/O, serialization and more, with C# examples.

Starting Exam 70-536 Study
After a burnout, I'm putting my own project on hold to study for Microsoft exam 70-536.

Design Patterns - Proxy Pattern
The Proxy Pattern, and the last article in the design patterns series, now that I've finished reading Head First Design Patterns.




