VOOZH about

URL: https://www.geeksforgeeks.org/java/copyonwritearraylist-isempty-method-in-java/

⇱ CopyOnWriteArrayList isEmpty() method in Java - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

CopyOnWriteArrayList isEmpty() method in Java

Last Updated : 11 Jul, 2025
The isEmpty(E e) method of CopyOnWriteArrayList checks if the list is empty or not. It returns true if the list is empty, else it returns false. Syntax:
public boolean isEmpty()
Parameters: The function does not accepts any parameter. Return Value: The function returns true if the list is empty, otherwise it returns false. Below programs illustrate the above function: Program 1:
Output:
CopyOnWriteArrayList: [32, 67, 98, 100]
List is not empty
List is empty
Program 2:
Output:
CopyOnWriteArrayList: [gopal, gfg, jgec, sudo]
List is not empty
List is empty
Reference: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CopyOnWriteArrayList.html#isEmpty--
Comment