Summary of Java Collections

Source: Internet
Author: User

    /**     * Collection * List (Access ordered, indexed, can be repeated) * ArrayList * The underlying is an array implementation, thread unsafe, find and modify                 Fast, increment and delete slow * linkedlist * Bottom is linked list implementation, thread insecure, increase and delete faster, find and modify slower * Vector *             The bottom is the implementation of the array, thread-safe, whether add or delete changes are slow * if you find and modify more, with ArrayList * If you increase and delete more, with LinkedList *     If you have more, use ArrayList * Set (Access unordered, no index, can not be repeated) * HashSet * Bottom is the hash algorithm implementation     * Linkedhashset * The underlying is a linked list implementation, but also can guarantee the element unique, and the same as HashSet principle * TreeSet * The bottom is a two-fork tree algorithm implementation * Generally in the development of the time do not need to order the stored elements, so in the development of most use hashset,hashset efficiency is higher * Tre ESET in the interview time more, ask you have several sorts of ways, and several sort of difference * Map * HashMap * Bottom is hash algorithm, for key * LINKEDH      Ashmap * Bottom is linked list, for key * TreeMap * Bottom is two fork tree algorithm, for key * development with more than HashMap*/

Summary of Java Collections

Related Article

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.