If I have the value "foo"
, and a HashMap<String> ftw
for which ftw.containsValue("foo")
returns true
, how can I get the corresponding key? Do I have to loop through the hashmap? What is the best way to do that?
↧
Java Hashmap: How to get key from value?
↧