Difference Between Array and Collection
Array | Collection |
---|---|
1. Size of arrays are fixed. | 1. Size of collection are growable in nature we can increase or decrease the size as our requirement. |
2. Memory point of view array concept not recommended to use. | 2. Memory point of view collection concept highly recommended to use. |
3. Arrays can hold only homogeneous elements. | 3. Collection can hold both homogeneous and heterogeneous objects. |
4. Arrays can hold both primitives and objects type elements. | 4. Collection can hold only objects. |
0 comments :
Post a Comment