Package java.util
Class LinkedList
boolean addAll(Collection c)
Overrides:
boolean addAll(int index, Collection c)
Overrides:
Throws:
_INSERT_METHOD_SIGNATURE_HERE_
Description:
addAll(Collection c) method:
Adds all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator. The behavior of this operation is undefined if the specified collection is modified while the operation is in progress.
addAll(int index, Collection c) method:
Inserts all the elements in the specified collection into this list, starting at the position specified by the index argument. Shifts the element currently at that position and any subsequnet elements to the right. The new elements will appear in the list in the order that they are returned by the specified collection's iterator.
Example
ArrayList arrayList = new ArrayList();
arrayList.add("L");
arrayList.add("i");
arrayList.add("n");
arrayList.add("k");
arrayList.add("e");
arrayList.add("d");
LinkedList linkedList = new LinkedList();
linkedList.addAll(arrayList);
Logger.log(linkedList.toString());
The example above constructs a new LinkedList, and adds all elements of the ArrayList. The result is written to the logger.