VOOZH about

URL: https://www.geeksforgeeks.org/java/arraylist-isempty-java-example/

⇱ ArrayList isEmpty() Method in Java with Examples - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

ArrayList isEmpty() Method in Java with Examples

Last Updated : 11 Jul, 2025

In Java, the isEmpty() method of ArrayList is used to check if an ArrayList is empty.

Example 1: Here, we use the isEmpty() method to check whether an ArrayList of integers is empty.


Output
true
false

Syntax of ArrayList isEmpty() Method

public boolean isEmpty()

Return Type: It returns a boolean value, true if the list is empty, otherwise false.

Example 2: Here, we use the isEmpty() method to check if an ArrayList of strings is empty.


Output
true
false


Example 3: Here, we will use the isEmpty() method to check if an ArrayList of Objects is empty.


Output
true
false
Comment