Javatpoint Logo
Javatpoint Logo

Java List isEmpty() Method

The isEmpty() method of List interface returns a Boolean value 'true' if this list contains no elements.

Syntax

Parameters

NA

Specified By

isEmpty in interface Collection<E>

Return

The isEmpty () method returns the Boolean value 'true' if this list contains no elements, else it returns false.

Example 1

Test it Now

Output:

Enter elements as this list is empty.

Example 2

Test it Now

Output:

Elements are already present in this list.
List : [null]
Next TopicJava List





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA