Javase 13th Day 20160819

Source: Internet
Author: User

(2), Java.util.HashSet class: The elements in the collection are sorted according to the hash value. When you create a collection, you can specify the length of the collection, and by default increase the length of the collection by 75% when the length is insufficient.

4. List Collection

(1) , ArrayList : Linear data structures, which are efficient when querying elements based on location, and inefficient when adding and deleting elements. You can specify the length of the collection when you create the collection .

(2) , LinkedList : Linked list data structure, high efficiency when adding and deleting elements, low efficiency when querying elements based on location. the length of the collection cannot be specified when the collection is created .

(3) , Vector : With ArrayList the same functionality. Vectors are thread-safe and ArrayList are thread insecure.

5.Map Collection

(1) , Hashtable : Thread-safe. Null is not allowed as a key or value.

(2) , HashMap : Thread is not secure. Null is allowed as a key or value.

Seven, generics: JDK1.5 began to appear.

1. Late-bound data type.

2. Generics must be a subclass of object or object.

3. If you do not specify a generic type, the default is type object.

4. Generic extends class: Adding a condition to a generic type

Javase 13th Day 20160819

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.