are arrays faster than arraylist?

Viewed 26344

My intuition says arrays are faster than arraylist because arraylists are implemented using arrays that resize as it fills up/loses elements.

I just wanted to confirm if this is true or not, implying there's never a reason to use an arraylist if you know the number of elements you want to hold.

8 Answers
Related