![]() |
VOOZH | about |
The isEmpty(E e) method of CopyOnWriteArraySet checks if the Set is empty or not. It returns true if the Set is empty, else it returns false.
Syntax:
public boolean isEmpty()
Return Value: The function returns true if the Set is empty, otherwise it returns false.
Below programs illustrate the above function:
Program 1:
CopyOnWriteArraySet: [32, 67, 98, 100] Set is not empty
Program 2:
CopyOnWriteArraySet: [] Set is empty
Reference: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CopyOnWriteArraySet.html#isEmpty--