Java Collection framework

Source: Internet
Author: User

Java Collection framework

Java Collection framework

1. Direct difference between Collection and Collections

Collection is an interface under the java. util package and a parent interface at the Collection framework level. List and set interfaces are commonly inherited. Allows you to insert, delete, and determine whether an element is a member or not, and traverse the element.

Collections is a tool class under the java. util package. It provides operations such as searching, sorting, replacing, and thread security in the collection.

Ii. list Interface

ArrayList: the underlying structure is array, fast query, slow insertion and deletion, and non-thread-safe. When the array exceeds the initial capacity, it will be resized by 50%.

Slow list: the underlying structure is linked list, slow query, fast insertion and deletion, and non-thread-safe.

Vector: the underlying structure is array, thread-safe, and is particularly slow in both insertion and query, extended by 100% of the array

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.