日期:2014-05-20 浏览次数:20720 次
package zhangming.csdn;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
public class ChineseMap
{
public static void main(String[] args)
{
Map<String,String> map = new TreeMap<String,String>();
map.put("王五","34"); //unicode码:\u738b\u4e94
map.put("刘露","24"); //unicode码:\u5218\u9732
map.put("赵四","45"); //unicode码:\u8d75\u56db
Set<Map.Entry<String,String>> set = map.entrySet();
for(Iterator<Map.Entry<String,String>> iter = set.iterator();iter.hasNext();)
{
Map.Entry<String,String> entry = iter.next();
System.out.println(entry.getKey() + " : " + entry.getValue());
}
}
}