Map a Collection

Hi,

I wonder why Map is considered Collection eventhough it does not implement Collection interface and whose behaviour is quite different from List or Set.

Please advise
LVL 7
gudii9Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CPColinSenior Java ArchitectCommented:
It's not a Collection. Who said it was?
0
ozoCommented:
"The other collection interfaces are based on java.util.Map and are not true collections. However, these interfaces contain collection-view operations, which enable them to be manipulated as collections"
http://docs.oracle.com/javase/7/docs/technotes/guides/collections/overview.html
0
gurpsbassiCommented:
This article  explains that it was a design decision.
Look at the heading "Why doesn't Map extend Collection?".
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

zzynxSoftware engineerCommented:
I wonder why Map is considered Collection
I would have been nice if you posted the link where you read that.

Besides that, I think maybe you read about a Map being considered a collection (with small 'c')
In that sense, a map is indeed a collection of key-value pairs (or a set of key-value pairs, but again also with a small 's')
Java seams to have "acquired" all available english words for 'collections' ;-)
0
gudii9Author Commented:
Besides that, I think maybe you read about a Map being considered a collection (with small 'c')
In that sense, a map is indeed a collection of key-value pairs (or a set of key-value pairs, but again also with a small 's')

Any book on java deals with Collection related chapter with Map right apart from Set and List.

I mean to say small 'c'
Big C is for interface right which is only being implemented by List and Set as attached
CollectionTop.png
0
zzynxSoftware engineerCommented:
I mean to say small 'c'
Well, then you got the answer: a map is a collection of key-value pairs
0
krakatoaCommented:
zzynx2015-05-22 at 16:05:33ID: 40791537

Map IS a member of the Java Collections framework. Please read the docs.

gurpsbassi already pointed to why this is so in his comment above.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.