![]() |
VOOZH | about |
The isEmpty() method of the List interface in Java is used to check if a list is empty or not. It returns true if the list contains no elements otherwise it returns false if the list contains any element.
Example:
List is Empty
boolean isEmpty()
Below is the implementation of isEmpty() Method:
[] : true [1, 2, 3] : false
Reference: https://docs.oracle.com/javase/7/docs/api/java/util/List.html#isEmpty()