How Does Arraylist Work In Java