for(int key: hm.keySet()) { if(hm.get(key).equals(value)) { System.out.println(key); }}
↧
Answer by Ashwin for Java Hashmap: How to get key from value?
↧
for(int key: hm.keySet()) { if(hm.get(key).equals(value)) { System.out.println(key); }}