This week's book / license giveaways are in the JDBC and Relational Databases and Java in General forums.
We're giving away four copies each of PostGIS in Action and Java Advanced Topics Training and have the authors on-line!
See this thread and this one for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Doubt in Maop Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Doubt in Maop" Watch "Doubt in Maop" New topic
Author

Doubt in Maop

sakthi moorthy
Ranch Hand

Joined: Oct 17, 2007
Posts: 54
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
Kelvin Chenhao Lim
Ranch Hand

Joined: Oct 20, 2007
Posts: 513
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.)


SCJP 5.0
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doubt in Maop