importjava.util.ArrayList; : imports the ArrayList class
ArrayList<Datatype> ArrayListname = new ArrayList<Datatype>();
ArrayList<Datatype> ArrayListname = new ArrayList<Datatype>();
ArrayListname.add(element) - Adds an element to the end of the list.
ArrayListname.set(index,element) - Sets the value of the element at the specifiedindex.Replaces the element currently at that position.
ArrayListname.remove(index) - Removes the element at the specified index.
ArrayListname.size() - Finds the number of elements currently stored in the arraylist.
ArrayListname.get(index) - Retrieves the element at the specifiedindex.
ArrayListname.add(index,element) - Adds an element at the specifiedindex. It will shift the element currently at that position to the right and any othersubsequentelements.