Question: how arraylist works internally in java?
Answer: ArrayList is a resizable array implementation of the List interface i.e. ArrayList grows dynamically as the elements are added to it. ... But the size of the array can not be increased dynamically. So, what happens internally is, a new Array is created and the old array is copied into the new array.