Removing an element from an ArrayList

Elements can be removed from an ArrayList in the following ways.

Removing an element at a particular index

We can use the remove(int index) method to remove an element at a particular index. The index should be less than the size of ArrayList, otherwise, IndexOutOfBoundsException is thrown.