Java List isEmpty() MethodThe isEmpty() method of List interface returns a Boolean value 'true' if this list contains no elements. SyntaxParametersNA Specified ByisEmpty in interface Collection<E> ReturnThe isEmpty () method returns the Boolean value 'true' if this list contains no elements, else it returns false. Example 1Test it NowOutput: Enter elements as this list is empty. Example 2Test it NowOutput: Elements are already present in this list. List : [null]
Next TopicJava List
|