I have a HashMap that is already populated. I'm iterating through the entrySet and want to get the keys and values and use them to create another object. I've searched the forum and googled but can't quite seem to find what I need. Here's the code I have so far.
Iterator iterator = map.entrySet().iterator();
while (iterator.hasNext()) {
if (iterator.next() != null) {
reasonsList.add(new DropDownData(key, value)); // here's where I'm not sure what to do
}
}
The DropDownData object accepts twos strings, one for the key and one for the displayed value. These strings should be the key and value from my current HashMap entry. But I can't seem to figure out how to do it.
thanks for any help/suggestions