ArrayList Class: ArrayList Class handles the dynamic array and List interface in java.util. It extends AbstractList class. ArrayList is actually an array of variable length which can be increased or decreased in size dynamically.
Types of constructors in ArrayList Class:
Type-1: To create an empty array list.
Type-2: Create an array list with elements of collection cl.
Type-3: Create an arry list that has size.
ensureCapacity( ) method: It is used to increase the capacity of the array list manually.
void ensureCapacity(int cp)
where, cp is capacity.