The difference between List,map,set interfaces in Java

Source: Internet
Author: User

From three points to analyze the difference between them:

1. Inherited interfaces are different:

The List,set interface is inherited from the collection interface, and the map interface is not, it is a top-level interface.

2. Own characteristics:

List: Used to process a sequence. The elements that are placed are ordered and can be duplicated.

Set: Used to process a collection. The elements that are placed are unordered and cannot be duplicated.

MAP: Used to handle key-value pairs. The key value cannot be duplicated, and if repeated, it is overwritten and placed in an unordered order.

3. Implementation class:

List: There are three implementation classes, ArrayList Vector LinkedList

Set: There are three implementation classes, HashSet TreeSet linkedhashset

Map: There are three implementation classes, HashMap HashTable Linkedhashmap

The difference between List,map,set interfaces in Java

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.