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.
Parameters: The function accepts a single parameter o i.e. to be checked for the presence in this set.
Return Value: The function returns a Boolean value. It returns True if the specified element is present in this set else it returns False.
Below programs illustrate the ConcurrentSkipListSet.contains() method:
9 is not present in the set.
Gfg is present in the set.
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.