Synchronized(ArrayList) method is used to get an ArrayList wrapper that is synchronized (thread safe).
public static System.Collections.ArrayList Synchronized (System.Collections.ArrayList list);
Here, the list is the ArrayList which is to be synchronized.
Return Value: It returns an ArrayList wrapper which is synchronized (thread safe).
Exception: This method throws ArgumentNullException if the list is null.
Below programs illustrate the use of above-discussed method:
myList is Not Synchronized. smyList is Synchronized.
System.ArgumentNullException: Value cannot be null.
Parameter name: list
Note: For the thread safety of the ArrayList, all operations must be done through this wrapper.