aspose file tools*
The moose likes Mock Exam Errata and the fly likes JXAM: Vector vs. List Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Mock Exam Errata
Bookmark "JXAM: Vector vs. List" Watch "JXAM: Vector vs. List" New topic
Author

JXAM: Vector vs. List

David Wake
Greenhorn

Joined: Apr 18, 2001
Posts: 17
Question: "Choose the class that can hold multiple equal objects in an ordered way.
A. Map
B. Collection
C. List
D. Set
E. Vector"
JXAM Correct Answer: C.
My answer: E.
My reasoning: java.util.List is an interface, not a class. Quote from Sun's javadoc for java.util.List: "Lists TYPICALLY allow duplicate elements." (my caps). Whereas Vector always does so.
Percy Densmore
Ranch Hand

Joined: Mar 06, 2001
Posts: 214
In my research I don't see Vector as being part of the collections framework, whereas 'List' seems to be the best one to hold equal objects due to the phrase "in an ordered way".
Percy
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi Percy,
Your research must not have been to in-depth. The Vector class is listed under See Also on the first page of the Collections API!
In answer to the question posed by David, I think List would be the best choice. My reasoning: Vector just uses List functionality to perform its job!
Regards,
Manfred.
Carlo Smits
Greenhorn

Joined: Jul 09, 2001
Posts: 22
But List is an interface, not a class. How could it be the answer to the question?
Jane Griscti
Ranch Hand

Joined: Aug 30, 2000
Posts: 3141
All the selections, except Vector, are interfaces. The question could have been worded 'choose the type'. Lists allow duplicates, and a Vector 'is a' list. It was retro-fitted in JDK 1.2 to fit into the Collections framework.
Hope that helps.
------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform


Jane Griscti
SCJP, Co-author Mike Meyers' Java 2 Certification Passport
Percy Densmore
Ranch Hand

Joined: Mar 06, 2001
Posts: 214
Manfred and Jane,
Belated thanks for the API update on Vector. Using older books is dangerous. We agree on List though as the correct answer
Percy
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Except that the question does ask for a class and List is not a class.
------------------
Tom - SCJP --- Co-Moderator of the Programmer Certification Forums


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JXAM: Vector vs. List