import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
public class Du {
public static void main(String[] args) {
HashMap
map.put("one", new Integer(111));
map.put("two", new Integer(22));
map.put("three", new Integer(3333));
List
List
for(int i = 0; i < map.size(); i++){
System.out.print("Key list element: " + keyList.get(i));
System.out.println("\nValue list element: " + valueList.get(i));
System.out.println();
}
}
}
public static void main(String args[]){
HashMap
aa.put("0","1");
aa.put("1","2");
aa.put("2","3");
ArrayList
ArrayList
上面的方法表示占同
}
public void MapToList(Map
List
List
Iterator iter = m.entrySet().iterator();
while (iter.hasNext()) {
Map.Entry entry = (Map.Entry) iter.next();
key.add(entry.getKey().toString());
value.add(entry.getValue().toString());
}
}