ConcurrentSkipListMap remove() method in Java with Examples Last Updated : 14 Feb, 2019 Comments Improve Suggest changes Like Article Like Report 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: Java // Java Program Demonstrate remove() // method of ConcurrentSkipListMap import java.util.concurrent.*; class GFG { public static void main(String[] args) { // Initializing the map ConcurrentSkipListMap<Integer, Integer> mpp = new ConcurrentSkipListMap<Integer, Integer>(); // Adding elements to this map for (int i = 1; i <= 5; i++) mpp.put(i, i); // remove() operation on the map mpp.remove(1); System.out.println("After remove(): " + mpp); } } Output: After remove(): {2=2, 3=3, 4=4, 5=5} Program 2: Java // Java Program Demonstrate remove() // method of ConcurrentSkipListMap import java.util.concurrent.*; class GFG { public static void main(String[] args) { // Initializing the map ConcurrentSkipListMap<Integer, Integer> mpp = new ConcurrentSkipListMap<Integer, Integer>(); // Adding elements to this map for (int i = 1; i <= 5; i++) mpp.put(i, i); // remove() operation on the map mpp.remove(5); System.out.println("After remove(): " + mpp); } } Output: After remove(): {1=1, 2=2, 3=3, 4=4} Reference: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ConcurrentSkipListMap.html#remove-java.lang.Object- Create Quiz Comment T Twinkl Bajaj Follow 0 Improve T Twinkl Bajaj Follow 0 Improve Article Tags : Misc Java Java-Collections Java - util package Java-Functions Java-ConcurrentSkipListMap Java-concurrent-package +3 More Explore Java BasicsIntroduction to Java3 min readJava Programming Basics9 min readJava Methods6 min readAccess Modifiers in Java4 min readArrays in Java7 min readJava Strings7 min readRegular Expressions in Java3 min readOOP & InterfacesClasses and Objects in Java5 min readAccess Modifiers in Java4 min readJava Constructors4 min readJava OOP(Object Oriented Programming) Concepts10 min readJava Packages2 min readJava Interface7 min readCollectionsCollections in Java12 min readCollections Class in Java13 min readCollection Interface in Java4 min readIterator in Java4 min readJava Comparator Interface5 min readException HandlingJava Exception Handling6 min readJava Try Catch Block4 min readJava final, finally and finalize4 min readChained Exceptions in Java3 min readNull Pointer Exception in Java5 min readException Handling with Method Overriding in Java4 min readJava AdvancedJava Multithreading Tutorial3 min readSynchronization in Java7 min readFile Handling in Java4 min readJava Method References7 min readJava 8 Stream Tutorial7 min readJava Networking6 min readJDBC Tutorial5 min readJava Memory Management3 min readGarbage Collection in Java6 min readMemory Leaks in Java3 min readPractice JavaJava Interview Questions and Answers1 min readJava Programs - Java Programming Examples7 min readJava Exercises - Basic to Advanced Java Practice Programs with Solutions5 min readJava Quiz1 min readJava Project Ideas For Beginners and Advanced15+ min read Like