#There are three main collection types in Java: set (set), list (list) and map (mapping).
1, List (orderly, duplicate) (Recommended learning: java course )
List Ordered and repeatable, List focuses on indexes and has a series of methods related to indexes, making query speed fast. Because when inserting or deleting data into the list collection, it will be accompanied by the movement of subsequent data, all insertion and deletion of data are slow.
2. Set (unordered, cannot be repeated)
The objects stored in Set are unordered and cannot be repeated. The objects in the set are not in a specific way. Sorting simply adds objects to a collection.
3. Map (key-value pairs, unique keys, non-unique values)
The Map collection stores key-value pairs. Keys cannot be repeated, but values can be repeated. . Obtain the value according to the key. When traversing the map collection, first obtain the set collection of the key, traverse the set collection, and obtain the corresponding value.
The collection class has three characteristics:
First, the collection class framework is high-performance. The implementation of the basic set of classes (dynamic arrays, linked lists, trees, and hash tables) is efficient. Most people rarely change these already mature and efficient APIs;
Second point, the collection class allows different types of collections to work in the same way and with a high degree of interoperability;
Third point Points are that the collection class is easy to extend and modify, and programmers can easily modify it to meet their own data structure needs.
The above is the detailed content of What collection types are there in java?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Dreamweaver Mac version
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version
Useful JavaScript development tools