• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 354
  • Last Modified:

collection map

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.
0
gudii9
Asked:
gudii9
  • 2
2 Solutions
 
cmalakarCommented:
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 ?
0
 
cmalakarCommented:
Check this for definitions of various collection interfaces..

http://download.oracle.com/javase/tutorial/collections/interfaces/index.html
0
 
for_yanCommented:
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

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now