标签:new style key str put string tor asn pre
1.定义 Map<String, Integer> map = new HashMap<String,Integer>(); 2.判断map中是否存在某个键的值: if(map.get(s)==null) 3.给map中某个键赋值: map.put(s, value); 4.map的遍历: 法一: Set<String> key = map.keySet(); for(String k:key) { System.out.println(k+":"+map.get(k)); } 法二: Iterator<String> it = key.iterator(); while(it.hasNext()) { String s = it.next(); System.out.println(s+":"+map.get(s)); }
标签:new style key str put string tor asn pre
原文地址:https://www.cnblogs.com/qdu-lkc/p/12207355.html