和遍历HashMap是一样的,有多种方法,给出计算较少的一种
ConcurrentHashMap map=....数据for(Map.Entry e: map.entrySet() ){ System.out.println("键:"+e.getKey()+", 值:"+e.getValue());}
你到jdk的demo里面搜索map,就会看到啦,你还可以到编辑器eclipse什么的上面先new个map,然后再到下面for,提示下就可以了