VOOZH about

URL: https://www.geeksforgeeks.org/c-sharp/stack-issynchronized-property-in-c-sharp/

⇱ Stack.IsSynchronized Property in C# - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Stack.IsSynchronized Property in C#

Last Updated : 11 Jul, 2025
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 thread safety of the Stack, all operations must be done through the wrapper returned by the Synchronized method. Also, retrieving the value of this property is an O(1) operation. Syntax:
public virtual bool IsSynchronized { get; }
Return Value: This property returns true, if access to the Stack is synchronized (thread safe) otherwise it returns false. The default is false. Below programs illustrate the use of above-discussed property: Example 1:
Output:
myStack is Not Synchronized.
ss is Synchronized.
Example 2:
Comment

Explore