Wednesday, 9 September 2015

Java- Differences between Array and ArrayList

Array
ArrayList
1) Stores primitive data types and also objects
Stores only objects . when we store primitive value , then with autoboxing features it automatically convert the value into object
2) Fixed size
Growable and resizable.
3) Stores similar data of one type  i.e , homogeneous
Can store heterogeneous data types
     4) Array is a fixed length data structure
ArrayList is a variable length Collection class

5) Elements accessible with index number
Accessing methods like get() etc.
6) can be Multidimensional
Single dimensional only .



No comments:

Post a Comment