• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Doubt in Maop

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Map is not in a collection interface , But Set , List are in collection interface. My doubt is What are all the Collection interface Operations do the Map can not Perform When Compare With Set , List
 
Ranch Hand
Posts: 513
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why not just take a look at the Collection and Map javadocs to find out for yourself?

As for the question of why Map is not a Collection, well, admittedly one can argue reasonably that a Map should indeed be considered some kind of Collection. But the designers of the Collections Framework ultimately decided that it's better to think of a Map not so much as a collection of objects, but rather as a relation between two collections. That's why the Map interface gives you accessors for the two underlying collections: keySet() and values(). You can then perform all your usual Collection operations on each of those two collections.

(However, Map also has an entrySet() method that muddles this view a little bit. You can read about that method in the javadoc, if you're not already familiar with it.)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic