다음을 통해 공유


LinkedHashSet.NewLinkedHashSet(Int32) Method

Definition

Creates a new, empty LinkedHashSet suitable for the expected number of elements.

[Android.Runtime.Register("newLinkedHashSet", "(I)Ljava/util/LinkedHashSet;", "", ApiSince=35)]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public static Java.Util.LinkedHashSet? NewLinkedHashSet (int numElements);
[<Android.Runtime.Register("newLinkedHashSet", "(I)Ljava/util/LinkedHashSet;", "", ApiSince=35)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
static member NewLinkedHashSet : int -> Java.Util.LinkedHashSet

Parameters

numElements
Int32

the expected number of elements

Returns

the newly created set

Attributes

Remarks

Creates a new, empty LinkedHashSet 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.LinkedHashSet.newLinkedHashSet(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.

Applies to