Taal

HashMap.NewHashMap(Int32) Method

Definition

Creates a new, empty HashMap suitable for the expected number of mappings.

[Android.Runtime.Register("newHashMap", "(I)Ljava/util/HashMap;", "", ApiSince=35)]
[Java.Interop.JavaTypeParameters(new System.String[] { "K", "V" })]
public static System.Collections.IDictionary NewHashMap(int numMappings);
[<Android.Runtime.Register("newHashMap", "(I)Ljava/util/HashMap;", "", ApiSince=35)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "K", "V" })>]
static member NewHashMap : int -> System.Collections.IDictionary

Parameters

numMappings
Int32

the expected number of mappings

Returns

the newly created map

Attributes

Remarks

Creates a new, empty HashMap suitable for the expected number of mappings. The returned map uses the default load factor of 0.75, and its initial capacity is generally large enough so that the expected number of mappings can be added without resizing the map.

Java reference for java.util.HashMap.newHashMap.

Applies to