![]() |
VOOZH | about |
The size() method of the List interface in Java is used to get the number of elements in this list. That is, the list size() method returns the count of elements present in this list container.
Example:
Size : 0
public int size()
Parameters: This method does not take any parameters.
Return Value: This method returns the number of elements in this list.
Example 1:
Size : 5
Example 2:
Size : 3