So I understand that an ArrayList has a variable length unlike an Array, but what are some of the advantages of using one over the other?
Asked
Active
Viewed 72 times
2 Answers
1
Array takes up less space and are typically faster, ArrayList lets you add and remove elements from your array (can be useful for a lot of reasons).

NendoTaka
- 1,224
- 8
- 14
0
Array is perfect, if you have a fixed number of items. It is fast and can be accessed by index.
ArrayList is more flexible, the list can easily extended by using add() function. ArrayList can also be accessed by index (using get(int i)).
So at the end it boils down to fixed length or not.

Thirdman
- 621
- 7
- 13