Fork me on GitHub

hasshmap输出value

 1 import java.util.HashMap;
 2 import java.util.Iterator;
 3 import java.util.Map;
 4 import java.util.Set;
 5 
 6 
 7 public class zengzhiwei {
 8     public static void main(String agrs[]) {
 9         System.out.println("hello world!");
10         Map<String, String> m = new HashMap<String, String>();
11         m.put("zengzhiwei", "zzw");
12         m.put("zengzhijie", "zzj");
13     
14         Set<String> s = m.keySet();
15         Iterator<String> itr = s.iterator();
16         while(itr.hasNext()) {
17             Object o = itr.next();
18             System.out.println(m.get(o));
19         }
20         
21     }
22 
23 }

 

posted @ 2016-02-24 19:36  ZZZZW  阅读(280)  评论(0编辑  收藏  举报
AmazingCounters.com