Java Container Record

Source: Internet
Author: User

The Java container can be divided into two types:

1, Collection: A sequence of independent elements that have one or more rules. The list saves the elements in the order in which they are inserted, the set cannot have duplicate elements, and the queue determines the order in which the objects are produced (usually in the order of insertion) according to the queuing rules. If they subdivide, there are:

1.1, ArrayList: Insert the order and save the same order, if the data inserted in the tail, performance OK, the data inserted in other parts of the poor

1.2, LinkedList: Insert the order and save the same order, chain data, insert data performance good

1.3, HashSet: Provide fast search technology, but there is no obvious order to save the element

1.4, TreeSet: results in ascending order to save the key

1.5, Linkhashset: According to the insertion of the Save key, while the speed of the query HashMap some of the spell,

2, Map: To save objects with key values, allowing you to use the built to find values, if they subdivide, there are:

2.1, HashMap: Provide fast search technology, but there is no obvious order to save the element

2.2, TreeMap: results in ascending order to save the key

2.3, Linkedhashmap: According to the insertion of the Save key, while the speed of the query HashMap some of the spell,

Java Container Record

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.