Java 10. Collections ArrayList and Arrays

1. The difference between collections and arrays

1. Arrays can store basic data types and reference data types.
Collections can only store reference data types, not basic data types.
If we want to store basic data types in a collection, we need to package the basic data types into wrapper classes.
insert image description here
2. Arrays Fixed length, variable length set

insert image description here

Second, the advantages of the collection

1. Automatically

2.

three,

1.

2.

Four,

1.

2.

five,

1.

2.

Guess you like

Origin blog.csdn.net/qq_43768851/article/details/127178814