The isEmpty() method of java.util.concurrent.ConcurrentSkipListMap is an in-built function in Java which returns boolean value that is it returns true if this map contains no key-value mappings otherwise false.
Syntax:
public boolean isEmpty()
Parameter: The function does not accepts any parameters.
Return Value: The function returns true if this map contains no key-value mappings or else false.
Below programs illustrate the above method:
Program 1:
// Java Program Demonstrate isEmpty() // 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); // checking if map is empty System.out.println(mpp.isEmpty()); } } |
false
Program 2:
// Java Program Demonstrate isEmpty() // 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>(); // checking if map is empty System.out.println(mpp.isEmpty()); } } |
true
Reference: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ConcurrentSkipListMap.html#isEmpty–
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
Recommended Posts:
- ConcurrentSkipListMap put() method in Java with Examples
- ConcurrentSkipListMap containsValue() method in Java with Examples
- ConcurrentSkipListMap ceilingKey() method in Java with Examples
- ConcurrentSkipListMap equals() method in Java with Examples
- ConcurrentSkipListMap remove() method in Java with Examples
- ConcurrentSkipListMap size() method in Java with Examples
- ConcurrentSkipListMap containsKey() method in Java with Examples
- ConcurrentSkipListMap clone() method in Java with Examples
- ConcurrentSkipListMap clear() method in Java with Examples
- Map isEmpty() Method in Java with Examples
- Set isEmpty() method in Java with Examples
- Properties isEmpty() method in Java with Examples
- SortedMap isEmpty() method in Java with Examples
- SortedSet isEmpty() method in Java with Examples
- CompoundName isEmpty() method in Java with Examples
- WeakHashMap isEmpty() Method in Java with Examples
- CompositeName isEmpty() method in Java with Examples
- Collection isEmpty() method in Java with Examples
- AbstractMap isEmpty() Method in Java with Examples
- AbstractCollection isEmpty() Method in Java with Examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

