java hashmap 测试代码问题
importjava.util.HashMap;importjava.util.Map;publicclasstestenum{publicstaticvoidmain(...
import java.util.HashMap;
import java.util.Map;
public class testenum {
public static void main(String[] args) {
Map mp=new HashMap();
mp.put("1", "aa");
mp.put("2", "bb");
mp.put("2", "cc");
mp.put("3", "cc");
mp.put("4", "dd");
System.out.println(mp);
while (!mp.isEmpty()) {
System.out.println(mp.containsKey(/*这里应该怎么写*/));
}
while (!mp.isEmpty()) {
System.out.println(mp.containsValue(/*这里应该怎么写*/));
}
}
} 展开
import java.util.Map;
public class testenum {
public static void main(String[] args) {
Map mp=new HashMap();
mp.put("1", "aa");
mp.put("2", "bb");
mp.put("2", "cc");
mp.put("3", "cc");
mp.put("4", "dd");
System.out.println(mp);
while (!mp.isEmpty()) {
System.out.println(mp.containsKey(/*这里应该怎么写*/));
}
while (!mp.isEmpty()) {
System.out.println(mp.containsValue(/*这里应该怎么写*/));
}
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询