Question: what is difference between capacity and size of arraylist?
Answer: An ArrayList object has a capacity and a size. The capacity is the total number of cells. The size is the number of cells that have data in them. ... Data are added in order.