use array instead of arraylist