Sunday, 9 July 2017

Difference between Arrays and collections

Difference between Arrays and collections

Arrays 
      
1) Array is a collection of homogeneous (similar) elements   
2) Arrays cannot grow and shrink dynamically.
3) Arrays can be accessed faster and less memory.

Collections  
  
1) It is a collection of homogeneous and heterogeneous elements
2) It can grow and shrink dynamically.
3) Collections are slow compared to arrays and consume more memory.

No comments:

Post a Comment