This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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.
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.
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