import java.util.*;
class MapDemo1
{
public static void main(String[] args)
{
Map<String,String> map=new HashMap<String,String>();
map.put("01","zhangsan1");
map.put("02","zhangsan2");
map.put("03","zhangsan3");
map.put("04","zhangsan4");
Set<String> set=map.keySet();
Iterator<String> it=set.iterator();
while(it.hasNext())
{
String key=it.next();
String value=map.get(key);
System.out.println(key+"***"+value);
}
}
}
|
|