- ArrayList is internally backed by Array in Java. So the performance for getting and replacing the elements based on index is similar for both the Arrays and ArrayLists. But, If ArrayList filled completely, then it performs resizing, this automatic resizing slow down the performance. But this performance issue is minimal.
- Array is a fixed length data structure, where as ArrayList is variable length collection.
- It is possible to store both primitive and objects in array. But ArrayList not support primitive types.
This blog is primarily focus on Java fundamentals and the libraries built on top of Java programming language. Most of the post are example oriented, hope you have fun in reading my blog....:)
Friday, 1 August 2014
Array Vs ArrayList
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment