Java CopyOnWriteArrayList clone() MethodThe clone() method of Java CopyOnWriteArrayList class returns a shallow copy of this list. In this method, elements themselves are not copied. Syntax:Returns:This method returns a clone of this list. Example 1Test it NowOutput: Clone List is : [1, 2, 1, 4, 5, 3, 3, 8] Example 2Test it NowOutput: Clone List is : [] Example 3Test it NowOutput: Clone List is : [Tom, Harry, John, John, John, Jerry] Example 4Test it NowOutput: Clone List is : [] Next TopicJava CopyOnWriteArrayList |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India