ConcurrentSkipListSet isEmpty() method in Java Last Updated : 17 Sep, 2018 Summarize Comments Improve Suggest changes Share Like Article Like Report The java.util.concurrent.ConcurrentSkipListSet.isEmpty() method is an in-built function in Java which is used to check if this set is empty or not. Syntax: ConcurrentSkipListSet.isEmpty() Parameters: The function does not accepts any parameter. Return Value: The function returns a boolean value. It returns true if the ConcurrentSkipListSet is empty and returns false otherwise. Below programs illustrate the ConcurrentSkipListSet.IsEmpty() method: Program 1: In this program the ConcurrentSkipListSet is non-empty. Java // Java Program to demonstrate isEmpty() // method of ConcurrentSkipListSet() import java.util.concurrent.*; class ConcurrentSkipListSetIsEmptyExample1 { public static void main(String[] args) { // Creating a set object ConcurrentSkipListSet<Integer> Lset = new ConcurrentSkipListSet<Integer>(); // Adding elements to this set for (int i = 10; i <= 50; i += 10) Lset.add(i); // Checks if this set is empty or not if (Lset.isEmpty()) System.out.println("The set is empty."); else System.out.println("The set is non-empty."); } } Output: The set is non-empty. Program 2: In this program the ConcurrentSkipListSet is empty. Java // Java program to demonstrate isEmpty() // method of ConcurrentSkipListSet() import java.util.concurrent.*; class ConcurrentSkipListSetIsEmptyExample2 { public static void main(String[] args) { // Creating a set object ConcurrentSkipListSet<Integer> Lset = new ConcurrentSkipListSet<Integer>(); // Checks if this set is empty or not if (Lset.isEmpty()) System.out.println("The set is empty."); else System.out.println("The set is non-empty."); } } Output: The set is empty. Reference : https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ConcurrentSkipListSet.html#add(E) Comment More infoAdvertise with us Next Article ConcurrentSkipListSet last() method in Java R rupesh_rao Follow Improve Article Tags : Misc Java Java-Collections Java - util package Java-Functions Java-ConcurrentSkipListSet +2 More Practice Tags : JavaJava-CollectionsMisc Similar Reads ConcurrentSkipListSet iterator() method in Java The iterator() method of java.util.concurrent.ConcurrentSkipListSet is an in-built function in Java which is used to return an iterator over the elements in this set in ascending order. Syntax: ConcurrentSkipListSet.iterator() Return Value: The function returns an iterator over the elements in this 2 min read ConcurrentSkipListSet first() method in Java The first() method of java.util.concurrent.ConcurrentSkipListSet is an in-built function in Java which returns the first (lowest) element currently in this set. Syntax: ConcurrentSkipListSet.first() Return Value: The function returns the first (lowest) element currently in this set. Exception: The f 1 min read ConcurrentSkipListSet add() method in Java The java.util.concurrent.ConcurrentSkipListSet.add() method is an in-built function in Java which is used to insert an element in this set. Syntax: ConcurrentSkipListSet.add(E e) Parameters: The function accepts a single parameter e i.e. the element to be inserted. Return Value: The function returns 2 min read ConcurrentSkipListSet contains() method in Java The contains() method of java.util.concurrent.ConcurrentSkipListSet is an in-built function in Java which returns a true boolean value if the specified element is present in this set otherwise it returns false. Syntax: ConcurrentSkipListSet.contains(Object o) Parameters: The function accepts a singl 2 min read ConcurrentSkipListSet last() method in Java The last() method of java.util.concurrent.ConcurrentSkipListSet is an in-built function in Java which returns the last (highest) element currently in this set. Syntax: public E last() Return Value: The function returns returns the last (highest) element currently in this set. Exception: The function 2 min read ConcurrentSkipListSet higher() method in Java The higher(E e) method of java.util.concurrent.ConcurrentSkipListSet is an in-built function in Java which returns the least element in this set strictly greater than the given element, or null if there is no such element. Syntax: public E higher(E e) Parameter: The function accepts a single paramet 2 min read Like