Package java.util
Class LinkedList
void add(int index, Object element)
Overrides:
boolean add(Object o)
Overrides:
_INSERT_METHOD_SIGNATURE_HERE_
Description:
add(int index, Object element) method:
Inserts the sepcified element at the position specified by the index argument. Shtifts the element currently at that position and any subsequent elements to the right.
add(Object element) method:
Adds the specified element to the end of this list.
Example
LinkedList linkedList = new LinkedList();
linkedList.add("L");
linkedList.add("i");
linkedList.add("n");
linkedList.add("k");
linkedList.add("e");
linkedList.add("d");
Logger.log(linkedList.toString());
The example above constructs a new LinkedList, adds elements to the list, and writes the elements to the logger.