Courses
Tutorials
Practice
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
Web Technologies
37.4K+ articles
DSA
22.8K+ articles
Python
21.3K+ articles
Experiences
16.6K+ articles
Interview Experiences
14.1K+ articles
JavaScript
12.2K+ articles
C#
1.9K+ articles
CSharp-method
701+ articles
CSharp-Collections-Namespace
196+ articles
CSharp-Stack-Class
3+ articles
CSharp-Collections-Stack
16 posts
Recent Articles
Popular Articles
C# Stack with Examples
Last Updated: 31 January 2025
In C# a Stack is a Collection that follows the Last-In-First-Out (LIFO) principle. It is used when we need last-in, first-out access to items. In C# there are both generic...
read more
C#
CSharp-Collections-Stack
How to get Synchronize access to the Stack in C#
Last Updated: 18 February 2019
Stack.SyncRoot Property is used to get an object which can be used to synchronize access to the Stack. Stack represents last-in, first out collection of object. It is used...
read more
C#
CSharp-Collections-Namespace
CSharp-Collections-Stack
C# | How to create a Stack
Last Updated: 18 February 2019
Stack() constructor is used to initialize a new instance of the Stack class which will be empty and will have the default initial capacity. Stack represents a last-in, fir...
read more
C#
CSharp-Collections-Namespace
CSharp-Collections-Stack
Stack.ToString() Method in C# with examples
Last Updated: 18 February 2019
ToString method is inherited from the Object class which is used to get a string that represents the current object. It can also apply on the Stack. It returns a string wh...
read more
C#
CSharp-Collections-Namespace
CSharp-Collections-Stack
Stack.Equals() Method in C#
Last Updated: 28 January 2019
Equals(Object) Method which is inherited from the Object class is used to check if a specified Stack class object is equal to another Stack class object or not. This metho...
read more
C#
CSharp-method
CSharp-Collections-Namespace
CSharp-Collections-Stack
Stack.IsSynchronized Property in C#
Last Updated: 04 February 2019
This method(comes under System.Collections namespace) is used to get a value indicating whether access to the Stack is synchronized (thread safe) or not. To guarantee the ...
read more
C#
CSharp-Collections-Namespace
CSharp-Collections-Stack
Stack.Synchronized() Method in C#
Last Updated: 04 February 2019
This method(comes under System.Collections Namespace) is used to return a synchronized (thread safe) wrapper for the Stack. To guarantee the thread safety of the Stack, al...
read more
C#
CSharp-method
CSharp-Collections-Namespace
CSharp-Collections-Stack
Stack.GetEnumerator Method in C#
Last Updated: 04 February 2019
This method returns an IEnumerator that iterates through the Stack. And it comes under the System.Collections namespace.Syntax:public virtual System.Collections.IEnumerato...
read more
C#
CSharp-method
CSharp-Collections-Namespace
CSharp-Collections-Stack
Stack.Push() Method in C#
Last Updated: 04 February 2019
This method(comes under System.Collections namespace) is used to inserts an object at the top of the Stack. If the Count already equals the capacity, the capacity of the S...
read more
C#
CSharp-method
CSharp-Collections-Namespace
CSharp-Collections-Stack
Stack.Contains() Method in C#
Last Updated: 04 February 2019
This method(comes under System.Collections namespace) is used to check whether a specified element is present is Stack or not. Internally this method checks for equality b...
read more
C#
CSharp-method
CSharp-Collections-Namespace
CSharp-Collections-Stack
Stack.Pop() Method in C#
Last Updated: 04 February 2019
This method(comes under System.Collections namespace) is used to remove and returns the object at the top of the Stack. This method is similar to the Peek method, but Peek...
read more
C#
CSharp-method
CSharp-Collections-Namespace
CSharp-Collections-Stack
Stack.CopyTo() Method in C#
Last Updated: 04 February 2019
This method(comes under System.Collections namespace) is used to copy the Stack to an existing 1-D Array which starts from the specified array index. The elements are copi...
read more
C#
CSharp-method
CSharp-Collections-Namespace
CSharp-Collections-Stack
Stack.Clear Method in C#
Last Updated: 04 February 2019
This method(comes under System.Collections namespace) is used to remove all the objects from the Stack. This method will set the Count of Stack to zero, and references to ...
read more
C#
CSharp-method
CSharp-Collections-Namespace
CSharp-Collections-Stack
Stack.ToArray() Method in C#
Last Updated: 04 February 2019
This method(comes under System.Collections namespace) is used to copy a Stack to a new array. The elements are copied onto the array in last-in-first-out (LIFO) order, sim...
read more
C#
CSharp-method
CSharp-Collections-Namespace
CSharp-Collections-Stack
Stack.Peek Method in C#
Last Updated: 04 February 2019
This method(comes under System.Collections namespace) is used to return the object at the top of the Stack without removing it. This method is similar to the Pop method, b...
read more
C#
CSharp-method
CSharp-Collections-Namespace
CSharp-Collections-Stack
1
2
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !