Copies the entries in the specified dictionary into a new Hashtable with the default load factor, using the default hash code provider and the default comparer.
[Visual Basic] Overloads Public Sub New( _ ByVal d As IDictionary _ ) [C#] public Hashtable( IDictionary d ); [C++] public: Hashtable( IDictionary* d ); [JScript] public function Hashtable( d : IDictionary );
Exception Type | Condition |
---|---|
ArgumentNullException | d is a null reference (in Visual Basic Nothing). |
The initial capacity is set to the number of entries in the source dictionary. Capacity is increased as the number of buckets is increased based on the load factor.
The maximum load factor is the maximum ratio of entries to buckets. A smaller load factor means faster lookup at the cost of increased memory consumption. The default maximum load factor is 1.0, which is the best balance between speed and size.
When the actual load factor reaches the maximum load factor, the number of buckets is automatically increased to the smallest prime number that is larger than twice the current number of buckets.
The hash code provider dispenses hash codes for keys in the Hashtable. The default hash code provider is the key's implementation of GetHashCode.
The comparer is used to determine if two keys are equal. Every key in a Hashtable must be unique. The default comparer is the key's implementation of Equals.
The elements of the new Hashtable are sorted in the same order that the IDictionary 's enumerator iterates through the IDictionary.
Hashtable Class | Hashtable Members | System.Collections Namespace | Hashtable Constructor Overload List | IDictionary | GetHashCode | System.Object..Equals