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 Programmer Certification (SCJP/OCPJP) and the fly likes LinkedHashSet and order of elements 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 » Programmer Certification (SCJP/OCPJP)
Bookmark "LinkedHashSet and order of elements" Watch "LinkedHashSet and order of elements" New topic
Author

LinkedHashSet and order of elements

Barkat Mardhani
Ranch Hand

Joined: Aug 05, 2002
Posts: 787
A question for Dan's Collection exam:

Which of the following classes allow elements to be accessed in the order that they were added?
a. ArrayList
b. LinkedHashMap
c. LinkedHashSet
d. LinkedList
e. HashMap
f. HashSet
g. Hashtable
h. TreeMap
i. TreeSet
j. Vector
k. WeakHashMap
l. None of the above

The answer is d. I believe it should be c and d. What about a?
Barkat Mardhani
Ranch Hand

Joined: Aug 05, 2002
Posts: 787
My mistake. I was looking at wrong answer.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: LinkedHashSet and order of elements
 
Similar Threads
Dan's mock exam: collection classes
Map null values doubt
LinkedHashSet
is LinkedHashSet ordered?
order of elements returned by Iterator in Set