Differences between an array and any collection from the java Collection framework?

后端 未结 4 675
长发绾君心
长发绾君心 2021-02-02 16:29

As the title say I am looking into the \"Differences between an array and any collection from the java Collection framework\".

Thought it\'s high level enough to provide

4条回答
  •  囚心锁ツ
    2021-02-02 16:47

    There are 5 differences between Array and Collection as given below :

    1. Arrays are fixed in size, whereas some Collections are grow-able in nature.

    2. Arrays store homogeneous data. Collections store both homogeneous as well as heterogeneous data.

    3. In Arrays, there are no underlining data structures, whereas Collections have underlining data structures.

    4. Arrays are recommended for performance, whereas Collections are not.

    5. Arrays use more memory space as compared to Collections.

提交回复
热议问题