[GR-Jug] need help with HashMap

Jeff Markham jeff.markham at markhamsoft.com
Tue Nov 18 15:16:46 EST 2003


java.util.HashMap myHashMap;
java.util.Set keys = myHashMap.keySet();
java.util.Iterator i = keys.iterator();
while(i.hasNext())
{
  Object key = i.next();
  System.out.println("key=" + key);
  System.out.println("value=" + myHashMap.get(key));
}



Quoting Ken Radlick <radlickk at gr-jug.org>:

> Does anyone have experience using the HashMap class?  If so, I am 
> looking for an example of how to traverse and print the keys and values 
> in the form key="key value" value="value".
> 
> Your assistance would be most appreciated.
> 
> Thanks,
> 
> Ken.
> 
> _______________________________________________
> Jug mailing list
> Jug at gr-jug.org
> http://gr-jug.org/mailman/listinfo/jug
> 




----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


More information about the Jug mailing list