ConcurrentSkipListSet clone() method in Java
The clone() method of java.util.concurrent.ConcurrentSkipListSet is an in-built function in Java which returns a shallow copy of this ConcurrentSkipListSet instance.
Parameters: The function does not accept any parameter.
Return Value: The function returns a shallow copy of ConcurrentSkipListSet.
Below programs illustrate the ConcurrentSkipListSet.clone() method:
The set contains: [10, 11, 12, 13, 14, 15] The clone set contains: [10, 11, 12, 13, 14, 15, 16]
The set contains: [Gfg, fun, is] The clone set contains: [Gfg, fun, is, site]
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.