Hashtable Constructor (Int32)

Initializes a new, empty instance of the Hashtable class using the specified initial capacity and the default load factor.

Namespace: System.Collections
Assembly: mscorlib (in mscorlib.dll)

Syntax

public Hashtable (
         intcapacity
)

Parameters

  • capacity
    The approximate number of elements that the Hashtable object can initially contain. The default is 4.

Remarks

The load factor is the maximum ratio of elements to buckets. A smaller load factor means faster lookup at the cost of increased memory consumption. The default value is 2.

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.

Version Information

Available in the .NET Micro Framework version 4.1.

See Also

Reference

Hashtable Class
Hashtable Members
System.Collections Namespace