A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Converting Hash map to linked list
Joined: Nov 16, 2006
Sep 21, 2007 22:25:00
Is there any way of converting from hash map to linked list.please tell me.
thanks in advance.
Joined: Oct 27, 2005
Sep 22, 2007 03:31:00
First of all, you're posting in the wrong forum. This has nothing to do with Swing, AWT etc.
Second of all, what do you want to put in the linked list? The keys or the values?
Anyway, here's some code that should do it for you:
Map<String,Integer> map; List<String> keys = new LinkedList<String>(map.keySet()); List<Integer> values = new LinkedList<Integer>(map.values());
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions
How To Answer Questions
I agree. Here's the link:
subject: Converting Hash map to linked list
HashMap and LinkedHashMap
Html atribute grabber
Storing ActionForm&action class-WHERE?
K&B Java 5 scjp ch7 page 24/114
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015