The
clone() method of
java.util.concurrent.ConcurrentSkipListSet is an in-built function in Java which returns a shallow copy of this ConcurrentSkipListSet instance.
Syntax:
ConcurrentSkipListSet.clone()
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:
Program 1:
Output:
The set contains: [10, 11, 12, 13, 14, 15]
The clone set contains: [10, 11, 12, 13, 14, 15, 16]
Program 2: