Java Knowledge Point Grooming

Source: Internet
Author: User
The difference between 1.ArrayList and LinkedList
ArrayList uses the array form to save the object, in this way the object is placed in a continuous position, so the biggest disadvantage is to insert the deletion is very troublesome; The advantage is faster lookups.
LinkedList uses the form of a list to hold objects, store objects in separate spaces, and save the next linked index in each space
But the disadvantage is that finding a lot of trouble starts with the first index.
The difference between 2.ArrayList and vector
ArrayList and vector implementations are arrays, (1) The synchronous vector is thread-safe, which means that his methods are thread-synchronized,
(2) ArrayList is thread insecure, and its methods are thread-out-of-sync.
If there is only one thread routines access to the collection, it is best to use ArrayList, because it is more efficient than thread-safe;
If you have more than one line routines access to the collection, it's best to use vectors, because we don't need to think about and write thread-safe code ourselves.
The difference between 3.HashMap and Hashtable
HashMap is thread insecure, Hashtable is thread-safe.

Java Knowledge Point Grooming

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.