
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Array IsSynchronized Property of Array Class in C#
The Array.IsSynchronized property in C gets a value indicating whether access to the Array is synchronized.
The IsSynchronized property is implemented by Arrays because it is needed by the System.Collections.ICollection interface. Classes using arrays can also implement own synchronization using the SyncRoot property.
The following is the syntax −
public bool IsSynchronized { get; }
The Array.IsSynchronized property implementation is the same like the SyncRoot property −
Example
using System; using System.Collections.Generic; using System.Linq; class Program { static void Main() { Array arr = new int[] { 2, 1, 9, 4, 8, 6,8 }; lock(arr.SyncRoot) { foreach (Object val in arr) Console.WriteLine(val); } } }
Output
2 1 9 4 8 6 8
Advertisements