Stack<T>

noun

say it: “STAK” /stæk/

A C# collection where the last item added is the first one taken off: last in, first out.

What is Stack<T> in C#?

Stack<T> — A last-in, first-out collection where the newest value is removed first.

class BrowserHistory
{
    Stack<string> pages = new();
}

In a sentence

  • “The editor keeps undo steps in a Stack<string>, so Undo removes the newest first.”

Level: Freelancer · More C# terms at this level

Updated