Partager via


Collections.EmptyList Method

Definition

Returns an empty list (immutable).

[Android.Runtime.Register("emptyList", "()Ljava/util/List;", "")]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public static System.Collections.IList EmptyList ();
[<Android.Runtime.Register("emptyList", "()Ljava/util/List;", "")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
static member EmptyList : unit -> System.Collections.IList

Returns

an empty immutable list

Attributes

Remarks

Returns an empty list (immutable). This list is serializable.

This example illustrates the type-safe way to obtain an empty list:

List&lt;String&gt; s = Collections.emptyList();

Added in 1.5.

Java documentation for java.util.Collections.emptyList().

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