English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I need Help with java HashMap.How do i convert from an arraylist to a hashmap.

2007-02-16 09:11:54 · 0 answers · asked by jose1008 2 in Computers & Internet Programming & Design

0 answers

Map map = new HashMap();
Iterator itrerator = list.iterator();
while (itrerator.hasNext())
{
anElement e = (anElement) itrerator.next();
map.put(e.getId, e);
}

Try this.
Good Luck
M.

2007-02-16 09:18:54 · answer #1 · answered by Martin G. 4 · 0 0

fedest.com, questions and answers