Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can I retrieve the items in my HashSet / HashMap in the order they were added?

added hashmap hashset items
0
10 Posted

How can I retrieve the items in my HashSet / HashMap in the order they were added?

0
10

Location: http://www.jguru.com/faq/view.jsp?EID=456424 Created: Jul 17, 2001 Author: John Zukowski (http://www.jguru.com/guru/viewbio.jsp?EID=7) Prior to Java 1.4, you had to manage a separate insertion order list yourself. Starting with Java 1.4, you can use the new LinkedHashMap / LinkedHashSet classes. The iterators you get back from them return the items in insertion order.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123