- Resizable (可調整大小)
- Performance (效能)
- Primitives (原函數)
- Iterating the values (數值迭代)
- Type-Safety
- Length
- Add elements
- Multi-dimensional
Array | ArrayList | |
---|---|---|
Resizable | No | Yes |
Primitives | Yes | No |
Iterating values | for, for each | Iterator , for each |
Length | length variable | size method |
Performance | Fast | Slow in comparision |
Multidimensional | Yes | No |
Add Elements | Assignment operator | add method |
原文摘自: http://javahungry.blogspot.com/2015/03/difference-between-array-and-arraylist-in-java-example.html