I am trying to simply print all key/value pair(s) in a ConcurrentHashMap.
I found this code online that I thought would do it, but it seems to be getting information ab
You can do something like
Iterator iterator = map.keySet().iterator(); while (iterator.hasNext()) { String key = iterator.next().toString(); Integer value = map.get(key); System.out.println(key + " " + value); }
Here 'map' is your concurrent HashMap.