C # Convert to Java, vector hashtable obsolete?

Source: Internet
Author: User

Vector Hashtable obsolete?

When you use the Java collection, the IDE prompts

Vectors and Hashtable are ArrayList, HashMap instead, while the former is thread-synchronized, do not know why? Is the reason for the poor efficiency?

Map
|--hashtable: The underlying is a hash table data structure that cannot be stored as a null key null value. The collection is thread-synchronized. jdk1.0. Low efficiency.
|--hashmap: The underlying is a hash table data structure that allows NULL values and NULL keys, which are not synchronized. Replace Hashtable, jdk1.2. High efficiency.
|--treemap: The bottom layer is a two-fork tree data structure. Thread is out of sync. Can be used to sort the keys in the map collection.

Legacy container classes, as well as arrays.

Classes that use Java.util.concurrent packages when multi-threading

C # Convert to Java, vector hashtable obsolete?

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.