![]() |
VOOZH | about |
Hashtable.Synchronized(Hashtable) Method is used to return a synchronized (thread-safe) wrapper for the Hashtable.
Syntax:
public static System.Collections.Hashtable Synchronized (System.Collections.Hashtable table);
Here table is the Hashtable which is to be synchronized.
Return Value: This method returns a synchronized (thread-safe) wrapper for the Hashtable.
Exception: This method will throw the ArgumentNullException if the table is null.
Below programs illustrate the use of above-discussed method:
Example 1:
Output:
has1 Hashtable is not synchronized. has2 Hashtable is synchronized.
Example 2:
Runtime Error:
Unhandled Exception:
System.ArgumentNullException: Value cannot be null.
Parameter name: table
Note:
Reference: