Difference between Arrays And Collections In Java


Arrays:-

Arrays are fixed in size.

Memory point of view arrays concept is not recommended to use.

Performance point of view arrays concept is highly recommended to use.

Arrays can hold only homogeneous data elements.

There is no underlying data structure for arrays. Hence ready-made method support is not                 available.

 


Collections:-

 Collections are grow-able in nature.

  Memory point of view collections concept is highly recommended to use.

  Performance point of view collections is not recommended to use.

 Collections can hold both Homogeneous & Heterogeneous objects.

 Underlying data structure is available for every collection class. Hence, ready-made method             support is available.

 Collections can be used to hold only objects but not for primitives.

 


 

Leave a Reply

Your email address will not be published. Required fields are marked *