I see besides the ability to increase the capacity, the other difference between an array and arraylist is that the latter does not allow the base type as primitive types. But since we have unboxing, which converts, saying, an Int type to Integer type, now arraylist can store any type. So why do we still need arrays?
Asked
Active
Viewed 103 times
0
-
7To implement arraylist. :P – Seyf Nov 20 '14 at 15:30
-
1Minor issue, you wrote *...we have unboxing, which converts, saying, an Int type to Integer type...* - other way around actually. [Unboxing](https://docs.oracle.com/javase/tutorial/java/data/autoboxing.html) unwraps an Integer to its corresponding int value. – Paul Richter Nov 20 '14 at 15:33