Java Collection Framework 01--Overview of the overall framework

Source: Internet
Author: User

The Java Collection Framework is a toolkit provided by Java, and in java.util.*, the package contains commonly used data structures: collections, arrays, linked lists, stacks, queues, mappings, and so on. The Java Collection framework can be divided into four parts: list lists, set sets, map mappings, and tool classes (iterator Iterators, enumeration enumeration classes, arrays, and collections).

The Java Collection framework is as follows:

As you can see, the collection framework in Java has two branches: collection and map.

1. Collection is an interface that contains the basic operations and properties of a collection. collection contains the list and set of two major branches

(1) List is an ordered queue, each element has its index, the index value of the first element is the 0,list implementation class has Arraylist,linkedlist,vector and stack.

(2) Set is a set that is not allowed to have duplicate elements. The implementation class for set has HashSet and TreeSet. HashSet relies on HashMap, which is actually implemented through HashMap; TreeSet relies on treemap, which is actually implemented by TreeMap.

2. Map is a mapped interface, which is a Key-value key-value pair. Each element in the map contains the value corresponding to a key and key.

(1) Abstractmap is an abstract class that implements most of the APIs in the map interface, and Hashmap,treemap,weakhashmap is both inherited and Abstractmap.

(2) Although Hashtable inherits from dictionary, it implements the map interface.

3. Iterator is a tool that iterates through a collection, and we typically use a iterator iterator to iterate through the collection. Collection relies on iterator because the collection implementation class implements the iterator () method and returns a iterator object. Listiterator is specifically designed to traverse the list.

4. Enumeration is an abstract class introduced by JDK1.0, as well as iterator, but it is also a traversal set, but enumeration is less powerful than iterator, and in the block diagram above, enumeration can only be used in hashtable,vector and stacks.

5. Arrays and collections are the two tool classes for the set of operand combinations, and they provide a number of useful methods.

The above is an overview of the set frame, if there are errors, please leave a message ~

Reprinted from Csdn Eson_15

Java Collection Framework 01--Overview of the overall framework

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.