Java from entry to proficient Chapter 13 Collection Class

A collection can be regarded as a container. Java provides different collection classes. These classes have different ways of storing objects and provide corresponding methods to facilitate users to traverse, add, delete, and find specified objects. .

One, the overview of the collection

  • The java.util package provides some collection classes, which are also called containers.
  • The difference between the collection class and the array is that the length of the array is fixed, and the length of the collection is variable.
  • Arrays are used to store basic types of data, and collections are used to store references to objects.
  • Commonly used collections include List collection, Set collection, and Map collection. List and Set inherit the Collection interface.

Insert picture description here

Guess you like

Origin blog.csdn.net/zhengzaifeidelushang/article/details/111243114