Deep Learning of Vector sets and deep learning of vector

Source: Internet
Author: User

Deep Learning of Vector sets and deep learning of vector

First, Vector is the list implementation provided by JDK. Like ArrayList, Vector is also implemented based on arrays.

Create an array of 10, assign values to the elementData object, and set capacityIncrement to 0.

The add method in the Vector adds the synchronized keyword, so this method is thread-safe. In addition, it is basically the same as the ArrayList. The difference is that when the array size is insufficient, the amplification policy is different (if capacityIncrement is greater than 0, the value of capacityIncrement is extended to the current size with the value of capacityIncrement. If capacityIncrement is less than 0, the Object array size is exaggerated to twice the existing size)

Except that the removeElement method called has the synchronized keyword, it is exactly the same as the arrayList.

The method has the syhchronized keyword, And the implementation is the same as that of ArrayList.

Identical to ArrayList

The only difference from ArrayList is that the indexOf method has the synchronized keyword.

Vector is a thread-safe ArrayList Based on synchronized. The amplification method is slightly different from that of ArrayList. You can pass in capacityIncrement to control capacity expansion.

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.