ConcurrentSkipListMap size() method in Java with Examples
The size() method of java.util.concurrent.ConcurrentSkipListMap is an in-built function in Java which that is it returns the number of keys mapped to this map. The size() method is not a constant time operation. In case the map contains more than Integer.MAX_VALUE elements, the maximum value of the map is returned.
public int size()
Parameter: The function does not accepts any parameters.
Return Value: The function returns the number of elements in this map.
Below programs illustrate the above method:
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.