Hashtable Constructor (Int32, Int32)

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

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

Syntax

public Hashtable (
         intcapacity,
         intmaxLoadFactor
)

Parameters

  • capacity
    The approximate number of elements that the Hashtable object can initially contain. The default is 4.
  • maxLoadFactor
    The load factor that results in a rehash of the Hashtable with a greater number of buckets.

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 using the value of the GrowthFactor property. The default value is 2.

Version Information

Available in the .NET Micro Framework version 4.1.

See Also

Reference

Hashtable Class
Hashtable Members
System.Collections Namespace