ArrayList methods
Of course, the full ArrayList specification is available with the rest of the Java documentation. Though I encourage you to explore all of the capabilities of ArrayLists, you will only be responsible for the following methods:
| Method name | Description |
|---|---|
| add(value) | adds the given value to the end of the list |
| add(index, value) | inserts the given value before the given index |
| clear() | removes all elements |
| contains(value) | returns true if the given element is in the list |
| get(index) | returns the value at the given index |
| indexOf(value) | returns the first index at which the given element appears in the list (or -1 if not found) |
| lastIndexOf(value) | returns the last index at which the given element appears in the list (or -1 if not found) |
| remove(index) | removes and returns value at given index, sliding others back |
| set(index, value) | replaces the element at position index with value and returns the element formerly at the specified position |
| size() | returns the number of elements in the list |




