HashSet.NewHashSet(Int32) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a new, empty HashSet suitable for the expected number of elements.
[Android.Runtime.Register("newHashSet", "(I)Ljava/util/HashSet;", "", ApiSince=35)]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public static Java.Util.HashSet NewHashSet (int numElements);
[<Android.Runtime.Register("newHashSet", "(I)Ljava/util/HashSet;", "", ApiSince=35)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
static member NewHashSet : int -> Java.Util.HashSet
Parameters
- numElements
- Int32
the expected number of elements
Returns
the newly created set
- Attributes
Remarks
Creates a new, empty HashSet suitable for the expected number of elements. The returned set uses the default load factor of 0.75, and its initial capacity is generally large enough so that the expected number of elements can be added without resizing the set.
Added in 19.
Java documentation for java.util.HashSet.newHashSet(int)
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.