collection map

Posted on 2011-05-06
Last Modified: 2012-05-11
I was reading folowing lines. And I did not understand clearly.
map combination of list and set. what it exactly means

Any ideas, resources,sample code,links, highly appreciated. thanks in advance.
Question by:gudii9
    LVL 23

    Assisted Solution

    List - a collection of elements. (even it can store duplicate elements)
    Set - a collection of unique elements. Does not allow duplicate elements.
    Map - a collection of key value pairs, in which it doesn't allow duplicate keys.

    Map and Set/List has lots of differences.

    Where did you read this ? what is the context of this line ?
    LVL 23

    Expert Comment

    Check this for definitions of various collection interfaces..
    LVL 47

    Accepted Solution

    List is a collection with associated order and with posibbly duplicated elements
    Set is a collection without order and which has no duplicate elements

    Map is made up of collection keys - these cannot have duplicate elements
    and in therefre they form a set (hence the method map.keySet()) - and
    collection ov vlaues - these can have duplicates - so they form a list
    Therefore Map cariies within itself  a Set of keys and a List of values
    In this sense it is a combination of Set and List with defined correspondence of elements


    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    linearIn  challenge 23 55
    Increment alphanumeric sequence 6 63
    countX 22 53
    mapAB Challlenge 35 57
    For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
    Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
    The viewer will learn how to implement Singleton Design Pattern in Java.
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now