标签:strong list集合 system tor print pre nta col asn
//1.第一种 HashMap map = new HashMap(); map.put("1", "value1"); map.put("2", "value2"); Iterator keys = map.keySet().iterator(); while(keys.hasNext()){ String key = (String)keys.next(); if("2".equals(key)){ System.out.println("存在key"); } } //2.第二种 boolean flag=map.containsKey("email")
List list=new ArrayList(); list.add("224"); list.add("2252"); list.add("226"); list.add("227"); if(list.contains("2252")){ System.out.print("包含"); }
List containsKey 和Map contains 判断集合中是否包含某个值
标签:strong list集合 system tor print pre nta col asn
原文地址:https://www.cnblogs.com/yysbolg/p/11095753.html