Example
Generate a duplicate of a list.
|
The clone() method yields a copy of the LinkedList as an Object.
This produces a “shallow” copy, implying that object copies within the list are not generated; instead, the list contains references to the same objects as the original list.
Note: Since the return type is Object, it needs to be typecasted to use it as a LinkedList, as illustrated in the example above.
public |
Returns: | A duplicate of the LinkedList object. |
---|