VOOZH about

URL: https://www.geeksforgeeks.org/java/concurrentskiplistset-add-method-in-java/

⇱ ConcurrentSkipListSet add() method in Java - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

ConcurrentSkipListSet add() method in Java

Last Updated : 17 Sep, 2018
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 a True boolean value. Below programs illustrate the ConcurrentSkipListSet.add() method: Program 1: Adding Integer in the set.
Output:
The set contains: 
10 20 30 40 50
Program 2: Adding String in the set.
Output:
The set contains: 
alex bob chuck drake eric
Reference: https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ConcurrentSkipListSet.html#add(E)
Comment