java collections and arrays difference

java collections and arrays difference:

Array:

Array: can be used to store a plurality of basic data types, it can be used to hold a plurality of objects.
Array : length is unchangeable, once to initialize the array to specify the length of the array (either dynamic or static initialization initialization).
Array : Unable to save data with a mapping relationships.
Collection :

Collection: only for varying amounts of stored objects.
Collection: The length is variable.
Collection: You can save data with the mapping relationships.
Same point:

Arrays and collections are similar containers.
difference:

Length of the array is fixed, the set of variable length.
Arrays can store objects of the same type, you can store a collection of different types of objects.
You can only store a collection of objects

Guess you like

Origin www.cnblogs.com/hewanli/p/12306479.html