Home >Java >Javagetting Started >What is the difference between collections and arrays in java
The difference between collections and arrays:
(Recommended tutorial: java introductory tutorial)
1. Arrays are of fixed length of; a collection of variable length.
2. Arrays can store basic data types or reference data types; collections can only store reference data types.
(Learning video recommendation: java course)
3. The elements stored in the array must be of the same data type; the objects stored in the collection can be of different data types.
The above is the detailed content of What is the difference between collections and arrays in java. For more information, please follow other related articles on the PHP Chinese website!