Java Collection 1

Source: Internet
Author: User

Java Collection notes 1

1. What is the origin of the collection?
We are learning Java-object-oriented-manipulating many objects--storing--containers (arrays and StringBuffer)--arrays whose lengths are fixed, so it is not suitable for changing requirements, and Java provides a collection for us to use.
2. What is the difference between a collection and an array?

A: Length Difference
Array pinning
Set Variable
B: Content Differences
An array can be a base type, or it can be a reference type
Collections can only be reference types
C: element content
Arrays can only store the same type
Collections can store different types (in fact, collections typically store the same type)

3. The inheritance architecture of the collection?
Because of the different requirements, Java provides different collection classes. The data structure of these multiple collection classes is different, but they are all to provide storage and traversal function, we take their generality upward extraction, and finally formed a collection of inheritance architecture diagram.

Collection
|--list
|--arraylist
|--vector
|--linkedlist
|--set
|--hashset
|--treeset

Java Collection 1

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.