Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
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
'Declaration
Public Sub New ( _
capacity As Integer, _
maxLoadFactor As Integer _
)
public Hashtable(
int capacity,
int maxLoadFactor
)
public:
Hashtable(
int capacity,
int maxLoadFactor
)
new :
capacity:int *
maxLoadFactor:int -> Hashtable
public function Hashtable(
capacity : int,
maxLoadFactor : int
)
Parameters
- capacity
Type: System. . :: . .Int32
The approximate number of elements that the Hashtable object can initially contain. The default is 4.
- maxLoadFactor
Type: System. . :: . .Int32
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.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.