VOOZH about

URL: https://www.geeksforgeeks.org/java/concurrentskiplistmap-remove-method-in-java-with-examples/

⇱ ConcurrentSkipListMap remove() method in Java with Examples - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

ConcurrentSkipListMap remove() method in Java with Examples

Last Updated : 14 Feb, 2019
The remove() method of java.util.concurrent.ConcurrentSkipListMap is an in-built function in Java which removes the mapping for the specified key from this map. The method returns null if there is no mapping for of that particular key. After this method is performed the size of the map is reduced. Syntax:
ConcurrentSkipListMap.remove(Object ob)
Parameter: The function accepts a single mandatory parameter ob which specifies the key whose mapping is to be removed. Return Value: The function returns the previous value associated with the specified key, or null if there was no mapping for the key. Below programs illustrate the above method:
Output:
After remove(): {2=2, 3=3, 4=4, 5=5}
Program 2:
Comment