public class Test {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
HashMap map = new HashMap();
map.put("key1", "value1");
map.put("key2", "value2");
map.put("key3", "value3");
Iterator keys = map.keySet().iterator();
while(keys.hasNext()){
String key = (String)keys.next();
if("key2".equals(key)){
System.out.println("这里面有key2");
}
}
}

}

相关文章:

  • 2022-12-23
  • 2021-12-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-26
  • 2022-02-14
猜你喜欢
  • 2022-12-23
  • 2021-11-04
  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
  • 2021-11-14
  • 2021-10-26
相关资源
相似解决方案