This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Mock Exam Errata and the fly likes JavaCaps: Map allows duplicates??!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Mock Exam Errata
Bookmark "JavaCaps: Map allows duplicates??!!" Watch "JavaCaps: Map allows duplicates??!!" New topic

JavaCaps: Map allows duplicates??!!

Jenny Hua

Joined: Jul 24, 2001
Posts: 8
in JavaCaps mock test (Title-10):
question #2.Which of the following allows duplicates , and introduces positional indexing.?
[a] Set
[b] Map
[c] Iterator
[d] List
To my surprise, the answer is b?! As I remember, Map doesnot allow duplicates in the collection, right?
who can help me to clear this?? Many thanks in advance!
Jane Griscti
Ranch Hand

Joined: Aug 30, 2000
Posts: 3141
Hi Jenny,
You're right. A Map cannot have duplicate keys. Believe the correct answer is 'd' List; which allows duplicates and allows you to specify an object's position within the list.
Check the API when in doubt
Hope that helps.
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform

Jane Griscti
SCJP, Co-author Mike Meyers' Java 2 Certification Passport
Jenny Hua

Joined: Jul 24, 2001
Posts: 8
Thank you very much, Jane!
I agree. Here's the link:
subject: JavaCaps: Map allows duplicates??!!
Similar Threads
JavaCaps Question 41
Javacaps Question 43
Javacaps-mock Q
What is JAVACAPS mock?
JavaCaps Mock exam