This week's book giveaways are in the iOS and Features new in Java 8 forums.
We're giving away four copies each of Barcodes with iOS: Bringing together the digital and physical worlds and Core Java for the Impatient 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

Win a copy of Barcodes with iOS this week in the iOS forum
or Core Java for the Impatient in the Java 8 forum!

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

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:
subject: Doubt in Maop