I\'ve got a HashMap and I need to fetch an item by its integer value. I notice there\'s a containsValue() function, but it would appear I still have to iterate through the m
you can use containsValue() in cases where you don't need to traverse the whole hashmap, for example if you want to add key-value pair to hashmap, but before that you want to know if that value is in hashmap. In this case for add operation you don't need to traverse whole hashmap.