public static String getKey(Map<String, Integer> mapref, String value) { String key = ""; for (Map.Entry<String, Integer> map : mapref.entrySet()) { if (map.getValue().toString().equals(value)) { key = map.getKey(); } } return key;}
↧
Answer by Amazing India for Java Hashmap: How to get key from value?
↧