Skip to content

Tag Archives: CSharp-Collections-Stack

A Stack represents a last-in, first-out collection of objects. It is used when you need last-in, first-out access to items. It is both a generic… Read More
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… Read More
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… Read More
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… Read More
This method is used to create a shallow copy of the Stack. It just creates a copy of the Stack. The copy will have a… Read More
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… Read More
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… Read More
This method(comes under System.Collections namespace) is used to get the number of elements contained in the Stack. The capacity is the number of elements that… Read More
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,… Read More
This method returns an IEnumerator that iterates through the Stack. And it comes under the System.Collections namespace. Syntax: public virtual System.Collections.IEnumerator GetEnumerator (); Below programs… Read More
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… Read More
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… Read More
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… Read More
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… Read More
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,… Read More