List's three sub-classes: ArrayList, question List, and Vector,

Source: Internet
Author: User

List's three sub-classes: ArrayList, question List, and Vector,
I. Features of the three subclasses of List

ArrayList:
The underlying data structure is an array, which provides fast query and slow addition and deletion.
The thread is not secure and the efficiency is high.
Vector:
The underlying data structure is an array, which provides fast query and slow addition and deletion.
Thread security and low efficiency.
Slow query of Vector Against ArrayList (thread-safe)
Slow addition/deletion of a Vector relative to the sorted list (array structure)
Shortlist:
The underlying data structure is a linked list, which is slow in query and fast in addition and deletion.
The thread is not secure and the efficiency is high.

Ii. Differences between Vector and ArrayList

Vector is thread-safe with Low Efficiency
ArrayList is thread unsafe and efficient.
Common feature: the underlying data structure is implemented by arrays, which results in fast query and slow addition and deletion.
Differences between ArrayList and rule list
The bottom layer of ArrayList is the array result, which is fast to query and modify.
The bottom layer of the shortlist is the linked list structure, with fast addition and deletion and slow query and modification.
In common: All threads are insecure.

Three lists are used by three sons.

Query multi-purpose ArrayList
Add, delete, and use the multiple objects list
If multiple arraylists exist

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.